`
LiYunpeng
  • 浏览: 950887 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

错误解决npm ERR! not a package /usr/local/bin/n

阅读更多
$ sudo npm install n -g
npm ERR! not a package /usr/local/bin/n
npm ERR! addLocal Could not install /usr/local/bin/n
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "n" "-g"
npm ERR! node v4.4.2
npm ERR! npm  v3.8.6
npm ERR! path /tmp/npm-64647-8937f140/unpack-b3c9aef5/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-64647-8937f140/unpack-b3c9aef5/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-64647-8937f140/unpack-b3c9aef5/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/bin/npm-debug.log




node
如果/usr/local/bin 下已经存在则会报如上错误,不要再这个文件夹下执行
npm install -g n的命令
执行
cd && npm install -g n
即可
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics