0
➜  bin vi npm
➜  bin npm install npm@latest -g
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "npm@latest" "-g"
npm ERR! node v6.8.0
npm ERR! npm  v3.10.8
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'realize-package-specifier'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/bin/npm-debug.log
➜  bin npm -v
3.10.8
➜  bin node -v
v6.8.0
➜  bin

npm安装任何依赖包都无效,但是npm和node确实都是OK的。换了国内的淘宝镜像也无效。

上传不了图片,贴下代码。

今天5月18日重新安装了node和npm,通过pkg安装包安装的,依然报错。真是日了狗了

WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/mip-cli/node_modules/utf-8-validate/.node-gyp"

查看全部 3 个回答