npm -g(global node modules)安装后使用显示Command not found

情景

win10系统,linux系统推荐参考here

如使用命令安装了hexo-cli

npm install -g hexo-cli

安装后命令行输入hexo却显示Command not found。

原因

global node module的文件夹没有在环境变量中

解决

%AppData%\npm
添加到环境变量中。

另:global安装的目录(npm -g目录)

使用 ```bash npm list -g --depth=0 ``` 或者 ```bash npm get prefix ``` 查看

参考

  1. Where does npm install packages?
  2. Global Node modules not installing correctly. Command not found

猜你喜欢

转载自blog.csdn.net/qq_34769162/article/details/108839178