mac安装node.js

1.官网下载node.js安装包,安装node.js的同时npm也会被安装
mac安装node.js
2.傻瓜式安装,一直到结束
3.安装完成后node -v或 npm -v 会报错command not found,这是因为path没有配置好
4. 打开终端:输入:touch ~/.bash_profilemac安装node.js
5. 然后输入open -t ~/.bash_profile会打开一个文本框,在第一行输入export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
mac安装node.js
mac安装node.js
6.command + s保存文件

7.在终端中输入source .bash_profile执行保存的文件
mac安装node.js
8.这时在终端中输入node -v 或npm -v就能出现版本号了
mac安装node.js