Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJS #299

Closed
tonyunreal opened this issue Nov 22, 2020 · 22 comments
Closed

NodeJS #299

tonyunreal opened this issue Nov 22, 2020 · 22 comments

Comments

@tonyunreal
Copy link
Contributor

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

@tonyunreal
Copy link
Contributor Author

tonyunreal commented Nov 22, 2020

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

tonyunreal added a commit to tonyunreal/doesitarm that referenced this issue Nov 23, 2020
@tinymachine
Copy link

@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?

@ThatGuySam
Copy link
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.

@tinymachine
Copy link

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

@jonathantneal
Copy link

jonathantneal commented Nov 24, 2020

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)"

@ThatGuySam
Copy link
Owner

ThatGuySam commented Nov 24, 2020

@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.

@ThatGuySam ThatGuySam reopened this Nov 24, 2020
@ThatGuySam
Copy link
Owner

ThatGuySam commented Nov 24, 2020

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

@ThatGuySam
Copy link
Owner

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

@ThatGuySam
Copy link
Owner

Update is live!

https://doesitarm.com/app/nodejs/

@Lee-Jp
Copy link

Lee-Jp commented Nov 26, 2020

What does Node v6 support look like?

@elliottkember
Copy link

@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.

@AdamGerthel
Copy link

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

Screenshot 2020-12-28 at 19 59 24

@richiksc
Copy link
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.

@ThatGuySam
Copy link
Owner

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

@rsboarder
Copy link

@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?

@AdamGerthel
Copy link

@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.

@rsboarder
Copy link

@AdamGerthel you installing via brew?

@toddjonker
Copy link

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.

@ThatGuySam
Copy link
Owner

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

@AdamGerthel
Copy link

@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.

@moffpage
Copy link

Why is it still an issue?

@ThatGuySam
Copy link
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
Projects
None yet
Development

No branches or pull requests