mac下node安装提示command not found

转载自:https://blog.csdn.net/u010394015/article/details/76423163

多谢博主~~~

手残安装了java环境,于是更改了环境变量,结果呀。node,npm 都显示command not found~~~~~~~~

通过一下博主方式更改回来滴~

第一步:创建.bash_profile文件,~表示在~目录下,.表示隐藏文件,打开终端,输入命令如下

touch ~/.bash_profile

第二步:打开.bash_profile文件,输入命令如下:

open -t ~/.bash_profile

第三步:这时候会弹出一个空白的文本编辑框,在文本编辑框里面第一行编辑:

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

command + s保存文件。

第四步:保存.bash_profile文件,输入命令:

source .bash_profile


 

第五步:再输入npm -v 或者node -v  就能看到版本号啦~

猜你喜欢

转载自blog.csdn.net/qq_39524670/article/details/81974174