我正在使用从Kurento网站获取的这段代码:
git clone https://github.com/Kurento/kurento-tutorial-node.git
cd kurento-tutorial-node/kurento-hello-world
git checkout 6.1.0
npm install
npm start
在运行第三行 npm install 之后,我遇到了这个错误:
npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm ERR! Error: EACCES, mkdir '/home/yashar/.npm/async/1.2.1'
npm ERR! { [Error: EACCES, mkdir '/home/yashar/.npm/async/1.2.1']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/yashar/.npm/async/1.2.1',
npm ERR! parent: 'kurento-client' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-71-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/yashar/kurento-tutorial-node/kurento-hello-world
npm ERR! node -v v0.10.41
npm ERR! npm -v 1.4.29
npm ERR! path /home/yashar/.npm/async/1.2.1
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/yashar/.npm/async/1.2.1'
npm ERR! not ok code 0
错误的来源是什么,请问如何解决?
答案 0 :(得分:1)
您已经以root身份安装/运行npm,os ~/.npm
文件夹中的权限是错误的。您可以运行sudo chown -R $(whoami) ~/.npm
来解决此问题。