Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 528 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
nvm install node fails to install on macOS Big Sur M1 Chip

#1
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++'
Reply

#2
Install nvm version > 0.3.7 and install node version >= 16.0
Reply

#3
Use the following command for successful install:

```
curl -o-

[To see links please register here]

| bash
```

before the above command, please be sure to have `.zshrc` file in the root of your current username folder (`~/`).
Reply

#4
it wasn't an issue while i was trying to install node 12.X.X but below that it was a big pain so i followed below steps and it worked for me

Uninstalled nvm if it’s already installed using Homebrew.

brew uninstall nvm
brew cleanup

Install Rosetta

softwareupdate --install-rosetta

Make terminal/iTerm2 to open in Rosetta mode

got to Application (-> utilities) -> right click on terminal app -> get Info -> Select "Open using Rosetta" -> Restart Terminal

In Terminal run a command

arch -x86_64 zsh

Make sure machine has .zshrc file if not just create one

cd ~
touch .zshrc

Install NVM

curl -o-

[To see links please register here]

| bash

And it should add the below piece of code to .zshrc


Restart the terminal and check if nvm is installed successfully by running

nvm -v


Then install Node with nvm as usual

nvm install 10


Reply

#5
I found a solution that really worked well here, am not going to write the entire steps please follow this link [\[Rosetta Terminal\]][1]


[1]:

[To see links please register here]

Reply

#6
The best instructions are on `nvm`'s own Readme's FAQ on Macs with M1 processors:

[To see links please register here]

Reply

#7
I did the following:

Run software update:
`softwareupdate --install-rosetta --agree-to-license`

Error in Rosetta Updater, but you can:
`grep RosettaUpdateAuto.pkg /var/log/install.log`

and just:
`open /path/to/RosettaUpdateAuto.pkg`

After that, right-click your terminal icon in dock > Open > Options > Show in Finder.

Then, right-click > Get Info.

Then, check 'Open using Rosetta'

In the terminal you can check you are using rosetta with:
`arch`

Then just:
`nvm install v6.9.1` # for example
Reply

#8
If you have installed `nvm` using `homebrew` and are trying to install the node using command `nvm install <some_version>`, you will face errors on apple silicon machines (ARM) for versions lower than 15. Node versions older than 15 do not work on apple silicon machines (ARM) because ARM architecture is not supported.
**For anything under v15, you will need to install node using Rosetta 2**.
1. How to open terminal in Rosetta2 mode: Go to Application -> Right click on terminal app -> Get Info -> Select "Open using Rosetta" -> Restart Terminal
2. In Terminal, write -> `arch -x86_64 zsh`

Now you will able to install any version of node (even multiple versions)
Reply

#9
In 2023, this is quite simple. Install nvm in the normal way **without** using Rosetta.

Then install Rosetta which you can install by running in the macOS Terminal:

`softwareupdate --install-rosetta`

Once installed, run

`arch -x86_64 zsh`

then if you want to install say 12

`nvm install lts/dubnium`

It will install, you can then use

`nvm use 12`

whenever you want to use 12, you don't have to do anything special to run it from here, it works without using `arch -x86_64 zsh`

Hope that helps!
Reply

#10
Follow these steps if you have M1/M2 and you have installed nvm via homebrew

rm -rf ~/.nvm
rm -rf ~/.npm
rm -rf ~/.bower

curl -o-

[To see links please register here]

| bash

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through