下面是我一直在犯的错误。这似乎表明了yodoctor的“后安装”问题。不幸的是,约曼医生是由约曼团队给出的帮助解决这个问题的建议。我还安装了其他node_modules (保龄球,咕噜,打字稿)。
sh: yodoctor: command not found
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! node v5.0.0
npm ERR! npm v3.3.9
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! yo@1.5.0 postinstall: `yodoctor`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the yo@1.5.0 postinstall script 'yodoctor'.
npm ERR! 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 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/jesselawson/.node_modules_global/lib/node_modules/npm-debug.log发布于 2016-02-03 06:42:35
造成此错误的原因通常是某些人在某个点使用了sudo并扰乱了他们的npm包目录权限。作为一条经验法则,永远不要使用sudo。
那你怎么能修好呢?这里有几个疑难解答要点:
npm install -g npm)。NPM2.x有一些竞争条件,可以在安装yodoctor之前尝试运行它。npm i -g yeoman-doctor && npm i -g yo强制安装它-但这确实是最后的追索权解决方案。发布于 2016-03-16 09:03:47
只需使用以下命令就可以完成任务:
sudo npm install -g yo如果没有,请查找yo所在的位置,将其添加到路径中,如下所示:
export PATH="$PATH:<path where yo is installed>"https://stackoverflow.com/questions/33487085
复制相似问题