簡體   English   中英

npm install會導致像npm ERR這樣的錯誤! Debian上的tar.unpack解壓錯誤

[英]npm install causes errors like npm ERR! tar.unpack untar error on Debian

作為在安裝咕嚕引導文件顯示,我第一次安裝grunt-cli全球與npm install -g grunt-cli ,現在我試圖執行npm install ,但只收到錯誤:

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 它奏效了。 所以,它似乎是一個共享文件夾問題。 但到底是什么? 為此共享文件夾啟用符號鏈接 ,我以管理員身份啟動了VM(當我在安裝Bower時出現類似問題時,它有所幫助)。

是什么導致了這些錯誤以及如何解決這個問題?

環境:VirtualBox與Debian客戶系統和Windows 7主機系統。

編輯

現在(我想我在非共享文件夾中成功執行了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身份啟動VM時:

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

好的,我看到了解決方案

 sudo npm cache clean

然后

sudo npm install -g grunt grunt-cli

我是在MacOS上做到的

嘗試做sudo npm cache clean 但它看起來問題是Windows的路徑太長(260字節限制),因此您無法共享該目錄。

我嘗試使用fenestrate,但它沒有為我工作。 您可能還想查看此條目

確保您的硬盤未滿。 那是我的情況。

我有類似的錯誤,以下沒有立即解決問題:

npm cache clean
rm -rf node_modules
npm install

事實證明我的虛擬機上的磁盤空間已用完。 在分配了一些空間並運行上面的命令之后,一切都按預期工作。

我面臨同樣的問題,我嘗試了這里建議的所有選項,但沒有成功。 最后,我在某處讀到了,我應該擁有超級用戶權限,所以我做到了

 sudo -s 

它似乎解決了這個問題。

對我來說, npm cache clean不起作用。 但是刪除有問題的目錄( npm刪除 ),然后只是重新安裝包!

在我的情況下,我嘗試在vagrant中安裝模塊,上面沒有任何工作,所以我嘗試在主機(OSX)上安裝它,它工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM