我一直在尝试使用以下命令通过SSH更新共享主机服务器(linux)上的npm:npm i npm @ latest -g
我不断收到此错误消息:
npm ERR! Linux 3.10.0-714.10.2.lve1.4.66.el6h.x86_64
npm ERR! argv "node" "/usr/bin/npm" "i" "npm@latest" "-g"
npm ERR! node v0.10.47
npm ERR! npm v3.8.3
npm ERR! path /usr/lib/node_modules/npm/node_modules/abbrev
npm ERR! code EACCES
npm ERR! Error: EACCES, access '/usr/lib/node_modules/npm/node_modules/abbrev'
npm ERR! at module.exports (/usr/lib/node_modules/npm/lib/install/access-error.js:4:18)
npm ERR! at /usr/lib/node_modules/npm/lib/install/writable.js:30:25
npm ERR! at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:232:16
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! { [Error: EACCES, access '/usr/lib/node_modules/npm/node_modules/abbrev']
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/npm/node_modules/abbrev' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
我试图遵循这个建议,
chown -R $USER /usr/local
但没有成功。
欢迎任何建议