Skip to content

NodeJS #299

Closed
Closed

Description

@tonyunreal

The official name of the app
Node.js

Is there a supported build available on a public/release channel?
No

Proposed App Status
Yes, full native support as of v15, requires building from source

Proposed App Category
Developer Tools

Related Issue Tracker Link or discussion
Official discussion: nodejs/TSC#886
User report on nvm build working: https://blockforums.org/topic/453-nodejs-on-apple-silicon-m1

Activity

  1. tonyunreal commented on Nov 22, 2020

    @tonyunreal
    ContributorAuthor

    Never mind, I just realized it was already reported in readme.md as "Node". Maybe this issue could serve further discussions if needed.

  2. tinymachine commented on Nov 23, 2020

    @tinymachine

    @ThatGuySam, the latest LTS of Node (14.15.1) works fine for me on an M1 MacBook Air via (I presume) Rosetta 2, so perhaps the status should be changed from ⏹ to ✳️ Yes, works via Rosetta 2?

  3. ThatGuySam commented on Nov 24, 2020

    @ThatGuySam
    Owner

    @tinymachine You can check if it's running in with Rosetta(Intel) or Native(Apple) by checking Activity Monitor.

    Feel free to drop a screenshot in here if you do.

  4. tinymachine commented on Nov 24, 2020

    @tinymachine

    Ah, of course -- thanks for the tip! 14.15.1 is currently working fine via Rosetta 2:
    Screen Shot 2020-11-23 at 9 49 04 PM

  5. jonathantneal commented on Nov 24, 2020

    @jonathantneal

    To whom it serves, you can install Node v15.3.0 on Apple Silicon.

    image

    here is how I did it:

    # from the temporary directory, download and untar Node v15.3.0
    echo "Downloading Node v15.3.0 (1/4)..."
    cd $TMPDIR
    curl -#OL https://nodejs.org/dist/v15.3.0/node-v15.3.0.tar.gz
    tar xf node-v15.3.0.tar.gz
    
    # configure the Node installation for arm64 on macOS
    echo "Installing Node v15.3.0 (2/4)..."
    cd $TMPDIR/node-v15.3.0
    ./configure --dest-cpu=arm64 --dest-os=mac
    
    # ensure node is built with m1 xcode tools and perform the installation (this takes about 10 minutes)
    BACKUP_PATH=$PATH PATH=/usr/bin:$PATH
    sudo make install -j8 V= DESTCPU="arm64" ARCH="arm64" VARIATION="" DISTYPE="release" RELEASE_URLBASE="https://nodejs.org/download/release/"
    PATH=BACKUP_PATH
    
    # ensure npm has global installation permissions
    echo "Permitting Node v15.3.0 (3/4)..."
    sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
    
    # update npm to verify the installation and permissions
    echo "Updating NPM (4/4)..."
    npm install -g npm

    EDIT: I’ve pushed the script to a URL, which should allow you to run the above script automatically:

    zsh -c "$(curl -fsSL http://jsxtools.com/curl/node)"
  6. ThatGuySam commented on Nov 24, 2020

    @ThatGuySam
    Owner

    @tinymachine You have a good point about changing the status to "✳️ Yes, works via Rosetta 2".

    However, v15 can run natively on ARM.

    So for clarity let's do this:
    The Status is based on the Active LTS version.

    So until Node 16 is officially released the status will be whatever v14 is.

    If v14 gets native arm support released then we'll update the status to Fully Native.

  7. ThatGuySam commented on Nov 24, 2020

    @ThatGuySam
    Owner

    Here's the current support as of Nov 24, 2020

    v14.15.1: ✳️ Yes, works via Rosetta 2
    v15.3.0: ✅ Native support with a workaround

  8. ThatGuySam commented on Nov 24, 2020

    @ThatGuySam
    Owner

    I'll link directly to that ^^ comment so people can get finer details on version support

  9. ThatGuySam commented on Nov 24, 2020

    @ThatGuySam
    Owner
  10. Lee-Jp commented on Nov 26, 2020

    @Lee-Jp

    What does Node v6 support look like?

  11. elliottkember commented on Dec 5, 2020

    @elliottkember

    @jonathantneal Thank you for your snippet! I tried it, but something went wrong and I get this:

      CXX(host) /private/var/folders/vx/6cq64y3d30dgs9fglm2456rr0000gn/T/node-v15.3.0/out/Release/obj.host/v8_base_without_compiler/gen/torque-output-root/torque-generated/class-verifiers-tq.o
      CXX(host) /private/var/folders/vx/6cq64y3d30dgs9fglm2456rr0000gn/T/node-v15.3.0/out/Release/obj.host/v8_base_without_compiler/gen/torque-output-root/torque-generated/factory-tq.o
      CXX(host) /private/var/folders/vx/6cq64y3d30dgs9fglm2456rr0000gn/T/node-v15.3.0/out/Release/obj.host/v8_base_without_compiler/gen/torque-output-root/torque-generated/objects-printer-tq.o
      CXX(host) /private/var/folders/vx/6cq64y3d30dgs9fglm2456rr0000gn/T/node-v15.3.0/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/heap/base/stack.o
      CXX(host) /private/var/folders/vx/6cq64y3d30dgs9fglm2456rr0000gn/T/node-v15.3.0/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/heap/base/asm/x64/push_registers_asm.o
    <inline asm>:4:8: error: unknown token in expression
      push %rbp
           ^
    <inline asm>:4:8: error: invalid operand
      push %rbp
           ^
    <inline asm>:5:7: error: unknown token in expression
    

    followed by a bunch more similar errors.

  12. AdamGerthel commented on Dec 28, 2020

    @AdamGerthel

    Node v15, which is the "Current" version, works without Rosetta:

    Screenshot 2020-12-28 at 19 59 24

  13. richiksc commented on Dec 30, 2020

    @richiksc
    Contributor

    I think this should be marked as Full Native Apple Silicon support, or it should be split up into two entries. v15 is still a stable, full-featured release, and it's much like Ubuntu - 20.10 is still a stable release, it's just that 20.04 is LTS.

  14. ThatGuySam commented on Dec 30, 2020

    @ThatGuySam
    Owner

    How about this:
    ✅ Yes, Full Native Apple Silicon Support as of v15

  15. rsboarder commented on Jan 25, 2021

    @rsboarder

    @jonathantneal I tried to install using your snippet by it failed with this error

    make[1]: /bin/sh: Bad address
    make[1]: *** [/private/var/folders/d1/fhw7tc315yn66plw3zgg5d3c0000gn/T/node-v15.6.0/out/Release/obj.target/v8_initializers/gen/torque-output-root/torque-generated/../../deps/v8/src/builtins/ic-tq-csa.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    rm a25728ab8eb3da324c06ae888715977bd383b7a9.intermediate 7961cfc3c172c83354f810b2ae2142c26e5ad587.intermediate cc4cc11b0d60296a583be691e4c222369fab8c07.intermediate
    make: *** [node] Error 2
    

    Maybe you know why is it so?

  16. AdamGerthel commented on Jan 25, 2021

    @AdamGerthel

    @jonathantneal I tried to install using your snippet by it failed with this error

    make[1]: /bin/sh: Bad address
    make[1]: *** [/private/var/folders/d1/fhw7tc315yn66plw3zgg5d3c0000gn/T/node-v15.6.0/out/Release/obj.target/v8_initializers/gen/torque-output-root/torque-generated/../../deps/v8/src/builtins/ic-tq-csa.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    rm a25728ab8eb3da324c06ae888715977bd383b7a9.intermediate 7961cfc3c172c83354f810b2ae2142c26e5ad587.intermediate cc4cc11b0d60296a583be691e4c222369fab8c07.intermediate
    make: *** [node] Error 2
    

    Maybe you know why is it so?

    You don't need a special snippet, you can just install it the regular way.

  17. rsboarder commented on Jan 25, 2021

    @rsboarder

    @AdamGerthel you installing via brew?

  18. toddjonker commented on Jan 25, 2021

    @toddjonker

    I'd really appreciate more explicit guidance on older releases; some of us are stuck on old things for various reasons and it would be nice to know whether that's going to block M1 adoption.

  19. ThatGuySam commented on Jan 26, 2021

    @ThatGuySam
    Owner

    @toddjonker What do you think would be a good solution?

  20. AdamGerthel commented on Jan 26, 2021

    @AdamGerthel

    @AdamGerthel you installing via brew?

    Nope, I installed via NVM. A month ago only v15 of node was supported but I installed v12 a few days ago without any problems.

    Some libraries might not work properly, for instance I've had trouble with node-sass. That's not something that a list like this can keep track of imo.

    It's definitely possible to simply install a different version of node in a Rosetta-launched terminal if needed.

  21. moffpage commented on May 21, 2021

    @moffpage

    Why is it still an issue?

  22. ThatGuySam commented on May 21, 2021

    @ThatGuySam
    Owner

    @moffpage This is just an older discussion from before the Node 16 release.

    I'll close it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions