【问题标题】:npm install error when following Angular2 5 min quickstart遵循 Angular2 5 分钟快速入门时出现 npm 安装错误
【发布时间】:2016-04-11 22:08:57
【问题描述】:

遵循 Angular2 5 分钟快速入门时出现错误。我怎样才能克服它?

vagrant@vagrant-ubuntu-trusty-64:/vagrant/angular2-tutorial$ sudo npm install   angular2-quickstart@1.0.0 /vagrant/angular2-tutorial
└── foxy@11.1.4  extraneous

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.6
npm WARN angular2-quickstart@1.0.0 No description
npm WARN angular2-quickstart@1.0.0 No repository field.
npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install"
npm ERR! node v5.4.0
npm ERR! npm  v3.5.2
npm ERR! path /vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename '/vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7' -> '/vagrant/angular2-tutorial/node_modules/browser-sync/node_modules/lodash'
npm ERR!     at destStatted (/usr/local/lib/node_modules/npm/lib/install/action/finalize.js:25:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename '/vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7' -> '/vagrant/angular2-tutorial/node_modules/browser-sync/node_modules/lodash'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM: operation not permitted, rename '/vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7' -> '/vagrant/angular2-tutorial/node_modules/browser-sync/node_modules/lodash'] parent: 'browser-sync' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install"
npm ERR! node v5.4.0
npm ERR! npm  v3.5.2
npm ERR! path npm-debug.log.727051537
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename

npm ERR! ETXTBSY: text file is busy, rename 'npm-debug.log.727051537' -> 'npm-debug.log'
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!     /vagrant/angular2-tutorial/npm-debug.log

这是错误日志: https://www.dropbox.com/s/xr6ha3z4re0npvi/npm-debug.log.727051537?dl=0

【问题讨论】:

  • 可能是权限问题?
  • 除了在命令前添加 sudo 之外,我还能尝试什么?

标签: node.js npm angular


【解决方案1】:

看起来这是权限问题。 npm 配置为将下载的模块放到未经授权的目录中。

您可以配置 npm 以使用其 prefix 配置将模块安装到自定义目录。

参考以下文章:

Use one of these techniques to install node and npm without having to sudo

Installing Node and npm

【讨论】:

  • 感谢您的建议。我使用您引用的列表中的顶级技术重新安装了节点。尝试 npm install 时仍然出现错误
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-30
  • 2016-04-16
  • 2016-04-11
  • 2016-06-22
  • 1970-01-01
相关资源
最近更新 更多