npm install会导致像npm ERR这样的错误! Debian上的tar.unpack解压错误

时间:2015-04-01 00:27:01

标签: linux node.js gruntjs npm virtualbox

按照显示的Bootstrap documentation安装Grunt,我首先使用grunt-cli全局安装了npm install -g grunt-cli,现在我正在尝试执行npm install,但只会收到错误:< / p>

root@devvm:/var/www/axit/portfolio/public/bower_components/bootstrap# npm install
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm WARN optional dep failed, continuing form-data@0.1.4
npm ERR! tar.unpack untar error /root/.npm/is-property/1.0.2/package.tgz
npm WARN optional dep failed, continuing request@2.54.0
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path /var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
npm ERR! code EPERM
npm ERR! errno 50

npm ERR! Error: EPERM, open '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js'
npm ERR!  { [Error: EPERM, open '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.ba707f2a7a688e388708bbe88e2dd4ed
npm ERR! code ETXTBSY
npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.ba707f2a7a688e388708bbe88e2dd4ed'
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!     /var/www/axit/portfolio/public/bower_components/bootstrap/npm-debug.log

我刚刚将项目复制到非共享文件夹中,然后再次启动npm install。它奏效了。所以,它似乎是一个共享文件夹问题。但到底是什么?对于这个共享文件夹Symlinks are enabled,我以管理员身份启动了VM(当我在安装Bower时出现类似问题时,它有所帮助)。

导致这些错误的原因是什么以及如何解决这个问题?

  

环境:使用Debian来宾系统和Windows 7主机系统的VirtualBox。

修改

现在(我想在我在非共享文件夹中成功执行npm install之后)我发现了不同的错误:

当我以常用方式启动VM时:

root@devvm:/var/www/axit/portfolio/public/bower_components/bootstrap# npm install
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm WARN optional dep failed, continuing form-data@0.1.4
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path ../semver/bin/semver
npm ERR! code UNKNOWN
npm ERR! errno -1

npm ERR! UNKNOWN, symlink '../semver/bin/semver'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.428531818e2d916d5ae79bdf94dd73b3
npm ERR! code ETXTBSY
npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.428531818e2d916d5ae79bdf94dd73b3'
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!     /var/www/axit/portfolio/public/bower_components/bootstrap/npm-debug.log

当我以Administrator

启动虚拟机时
root@devvm:/var/www/axit/portfolio/public/bower_components/bootstrap# npm install
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm WARN optional dep failed, continuing form-data@0.1.4
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path /var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy
npm ERR! code UNKNOWN
npm ERR! errno -1

npm ERR! UNKNOWN, mkdir '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.0bb66467f3aae813a34e03a797f8da19
npm ERR! code ETXTBSY
npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.0bb66467f3aae813a34e03a797f8da19'
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!     /var/www/axit/portfolio/public/bower_components/bootstrap/npm-debug.log

7 个答案:

答案 0 :(得分:9)

好的,我看到了解决方案

 sudo npm cache clean

然后

sudo npm install -g grunt grunt-cli

我是在MacOS上做到的

答案 1 :(得分:4)

尝试sudo npm cache clean。但它看起来问题是Windows的路径太长(260字节限制),所以你不能共享该目录。

我尝试使用fenestrate,但这对我没用。您可能还想查看this entry

答案 2 :(得分:4)

确保您的硬盘未满。那是我的理由。

答案 3 :(得分:1)

I had a similar error and the following did not immediately resolve the issue:

npm cache clean
rm -rf node_modules
npm install

It turns out I had run out of disk space on my virtual machine. After allocating some more space and running above commands everything worked as expected.

答案 4 :(得分:0)

我遇到了同样的问题,我尝试了这里建议的所有选项而没有成功。最后,我在某处读到了,我应该拥有超级用户权限,所以我做了

 sudo -s 

似乎解决了这个问题。

答案 5 :(得分:0)

对我来说 npm cache clean 不起作用。 然而,删除有问题的目录( npm删除),然后只是重新安装包!

答案 6 :(得分:0)

在我的情况下,我尝试在vagrant中安装模块,以上内容均无效,因此我尝试将其安装在主机(OSX)上,并且有效。