-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
nvm install node fails to install on macOS Big Sur M1 Chip #2350
Comments
Just installed for me on my m1 MacBook Air - nvm version 0.37.0 running Try upgrading your version of nvm. I just dowloaded via the Took a long time though - had to build node from source! |
I got a failure to install node v14 via NVM. I assumed nvm wasn't working, and attempted installing node v15 via brew (on ARM) and it succeeded. I'll try nvm again because I'd like older versions. --update-- I guess for now I'll live without old versions of node 😜 |
Old versions of node might simply not work on apple silicon machines. Definitely don’t install nvm via homebrew; i don’t support that. |
Yeah, existing versions of node 14 simply don't compile. I've opened a bug here: nodejs/node#36161 |
@andyaccelerate if you try with node 15 and the latest version of nvm, does everything work? If so, this should be closed. |
Installing older versions of Node wouldn't work for me either, tried v10 & v12 on the latest version of NVM. Took a long time but v15 installed successfully. |
The support for apple silicon is only on master and possibly 15.x. older versions are expected to not work because they are missing the correct version of V8 |
What would be ideal, then, is for nvm to detect that you're on Apple Silicon, and trying to install a version that's not supported (< 15, at least), and fail with a helpful message. I'll leave this open to track that. |
Quick warning that even once you've got the latest nvm up and running, you're going to be in a world of pain when you try to install dependencies. Pattern of...
then lots of build errors before it gives up, at least for me. So even though Node is limited to just building the latest, here's an OT heads up that lots of other stuff doesn't appear to be able to do even that. The Bleeding Edge Cuts (c) 1842. |
Indeed, that will always be the case for compiled deps, but many dep graphs intentionally avoid having those :-) |
Thanks guys, when I first installed nvm I took the install script link from an article that I didn't realise was a bit old and installed v0.33 rather than the latest v0.37. Updating nvm fixed my issue with being able to install the latest version of node, but of course it looks like there is still the issue of installing older versions of node (which is not really the same problem as with my initial issue, but i'm sure I would of run into that one as well). |
Just fyi - if you set the |
Wow! That's really really helpful! Saved me a lot of time and effort! |
using the latest version of nvm and i'm having this exact error as well on ubuntu though. Any suggestions on how to resolve it on linux? |
For anything under v15, you will need to install node using Rosetta 2. You can do this by running the nvm installation commands inside the Rosetta 2 shell. In Terminal, use
to start a shell under Rosetta 2. Then you can run After this, you can use the installed executable without being in Rosetta 2 shell, i.e. you can use node 15 along with other node versions interchangeably. This way you can use Rosetta on a need to use base and not need to run the whole terminal in Rosetta mode.
|
@williamli it would be great if you PRd a section into the readme for that :-) |
This worked for me. I was struggling big time. First generation Apple products are ..."fun". |
It looks like running However, building I'm not sure if this should be reported as a separate issue. See nodejs/TSC#886 (comment) |
This doesn't make sense, and is definitely not the case on my machine. Are you sure you're running the correct, nvm-compiled binary?
|
I have just got my M1 yesterday and it works like a charm as what @benwiggins said: |
I guess for those who got an x86 Node while you expect an arm64 Node, please check your Python. If Python is x86 then when Node is doing i.e. You may need to install Homebrew in arm64 mode, then install Python via that, and make sure your |
I just tried this again and it seems that
Not sure if the new minor version fixed it or maybe I had an incompatible Python which somehow got updated by something I did. Everything seems good now though. |
@ljharb let me work on it over the weekend. |
Is it okay if I start working on the README.md update for this? I got a new M1 recently and successfully installed v15 natively and v12 through rosetta. |
@hjoshi123 thatd be great! It’ll be important to differentiate how M1 users can install both an arm and a rosetta version of node. |
This comment has been minimized.
This comment has been minimized.
Installing v14 (nvm install v14) with "open using rosetta" marked and then opening again with it unmarked did the job for me. As I thought, you can use v14 without rosetta, only can't install it. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@imaddi47 what do you think about a PR to automate those steps in nvm itself? |
Sure! I would love to. |
quit the terminal |
thanks for the help , i have this issue : ERROR: Did not find a new enough assembler, install one or build with
--openssl-no-asm.
Please refer to BUILDING.md anyone know how to fix that ? on MBA M1 |
I get the following error, running on a m1 chip macbook. Any idea how to deal with this one, worth to note that I have gone through all of the above solutions.
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
( |
This comment was marked as spam.
This comment was marked as spam.
Not just with an M2; on all Macs. iTerm is just a commonly used userland shell. |
I think it is time to update the docs on Rosetta now. |
@kerberw PRs welcome :-) |
I'm trying to install the latest version of node using nvm. I've just got the newly released SIlicon Macbook Pro with the M1 chip (not sure if that is related). I've installed xcode on the app store and the xcode tools on the command line. The main error i'm getting is:
clang: error: no such file or directory: 'CXX=c++'
Full command output is at the bottom of the page.
Any help appreciated,
Thanks
Operating system and version:
MacOS Big Sur
nvm debug
output:nvm ls
output:How did you install
nvm
?install script in readme
What steps did you perform?
What happened?
The text was updated successfully, but these errors were encountered: