0

我正在使用从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

请问错误的根源是什么,如何解决?

4

1 回答 1

1

您已以 root 身份安装/运行 npm,但您的~/.npm文件夹中的权限是错误的。你可以跑来sudo chown -R $(whoami) ~/.npm解决这个问题。

于 2015-12-17T09:58:34.987 回答