node.js – npm ERR!错误:EPERM,chmod

前端之家收集整理的这篇文章主要介绍了node.js – npm ERR!错误:EPERM,chmod前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如果在尝试在USB设备上构建node.js应用程序时在我的覆盆子pi上使用npm时遇到一些问题.

package.json看起来像这样:

{
  "name" : "node-todo","version" : "1.0.0","description" : "TodoApp","main" : "server.js","autho" : "Stephan","dependencies" : {
     "express" : "*"
  }
}

使用npm install会导致:

npm WARN package.json node-todo@1.0.0 No repository field.
npm WARN package.json node-todo@1.0.0 No README data
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm ERR! Error: EPERM,chmod '/media/ServerHD/testraum/test/node_modules/express/package.json'
npm ERR!  { [Error: EPERM,chmod '/media/ServerHD/testraum/test/node_modules/express/package.json']
npm ERR!   errno: 50,npm ERR!   code: 'EPERM',npm ERR!   path: '/media/ServerHD/testraum/test/node_modules/express/package.json',npm ERR!   fstream_finish_call: 'chmod',npm ERR!   fstream_type: 'File',npm ERR!   fstream_path: '/media/ServerHD/testraum/test/node_modules/express/package.json',npm ERR!   fstream_class: 'FileWriter',npm ERR!   fstream_stack:
npm ERR!    [ '/opt/node/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19',npm ERR!      'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.12.28+
npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "install" "-no-bin-links"
npm ERR! cwd /media/ServerHD/testraum/test
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /media/ServerHD/testraum/test/node_modules/express/package.json
npm ERR! fstream_path /media/ServerHD/testraum/test/node_modules/express/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM,chmod '/media/ServerHD/testraum/test/node_modules/express/package.json'
npm ERR! fstream_stack /opt/node/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /media/ServerHD/testraum/test/npm-debug.log
npm ERR! not ok code 0

如果我尝试在/ home / myUser / Appfolder中运行npm install一切正常.
ServerHD上的所有文件都由homefolder所属的同一用户创建.
我试过用:

> npm install -no-bin-links会导致同样的问题
>尝试将ServerHD上的文件夹更改为777对npm没有任何影响
>尝试使用sudo运行npm install

使用快速生成器会导致类似的问题.

希望有人能提供帮助.谢谢到目前为止.

解决方法

我有类似的错误调用

npm缓存清理

帮我解决了.

原文链接:https://www.f2er.com/nodejs/241022.html

猜你在找的Node.js相关文章