安装yeoman出现错误npm ERR! yo@1.7.0 postinstall: `yodoctor`
程序员文章站
2022-03-23 18:46:17
...
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "yo" "-g"
npm ERR! node v4.4.2
npm ERR! npm v3.8.6
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! yo@1.7.0 postinstall: `yodoctor`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the yo@1.7.0 postinstall script 'yodoctor'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs yo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/LiYunpeng/npm-debug.log
参看
https://docs.npmjs.com/getting-started/fixing-npm-permissions
通过命令行查看
npm config get prefix
如果是user/local则可以执行下面的语句,如果只是user那么采用第二种方式(将node的文件夹移走)
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
将对应的文件夹授权
变量whoami就是当前用户的文件夹位置,npm config get prefix就是npm中配置的安装目录前缀
然后执行cd && npm install yo -g
貌似如果之前安装过yo,在/usr/local/bin/下已经存在yo的情况下,执行npm install yo -g会不允许,所以要cd &&
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "yo" "-g"
npm ERR! node v4.4.2
npm ERR! npm v3.8.6
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! yo@1.7.0 postinstall: `yodoctor`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the yo@1.7.0 postinstall script 'yodoctor'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs yo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/LiYunpeng/npm-debug.log
参看
https://docs.npmjs.com/getting-started/fixing-npm-permissions
通过命令行查看
npm config get prefix
如果是user/local则可以执行下面的语句,如果只是user那么采用第二种方式(将node的文件夹移走)
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
将对应的文件夹授权
变量whoami就是当前用户的文件夹位置,npm config get prefix就是npm中配置的安装目录前缀
然后执行cd && npm install yo -g
貌似如果之前安装过yo,在/usr/local/bin/下已经存在yo的情况下,执行npm install yo -g会不允许,所以要cd &&
上一篇: 不可变基础设施:拒绝SSH
下一篇: OOP/AD basic