Installation Of Node.js On MacOS
Regarding a new mac, oftentime it needs node to develope.We can use Homebrew command to install Node.js , or we may be able to directly visit the official Web to download appointed packages to conduct the installation.
Here I’ll demonstrate how to use package to install.
Go to Node.js to select a suitable version to use. To me, choosing LTS(long-term-support) version is a nice proposal here.
1 |
|
Just follow the tips of installation step by step then you can finish it.
Here are some commands to check the version of node.js
1 |
|
Change sources of dependencies.Noted that nrm(npm registry manager) is a tool of registry management.
1 |
|
Here you may meet the issue as below sometimes.
A solution for reference.
https://blog.csdn.net/qq_39132095/article/details/125568802
Final solution works to my macbook air(m2 chip) as below.
- Create ~/.npm-global file.
1 |
|
- Open and edit ~/.zshrc file.
1 |
|
- Add below to ~/.zshrc and save it with ‘x’.
1 |
|
- Reload ~/.zshrc to make it into effect.
1 |
|
- Continue to execute the installation command again.
1 |
|
After installation of nrm, we can see the source we are currently using.
1 |
|
To change the registry by following the command.
1 |
|
In the end of this article,I have to say “Guys,WELL DONE!!!!“.We have already finished the installation of node.js at a macbook air with ARM64 chip.