2015-04-01 181 views
8

安裝咕嚕tar.unpack解壓錯誤作爲Bootstrap documentation所示,我先用npm install -g grunt-cli安裝grunt-cli全球,現在我試圖執行npm install,但只收到錯誤:npm安裝導致npm ERR等錯誤!在Debian

[email protected]:/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 [email protected] 
npm ERR! tar.unpack untar error /root/.npm/is-property/1.0.2/package.tgz 
npm WARN optional dep failed, continuing [email protected] 
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爲這個共享文件夾,我作爲管理員啓動虛擬機(它幫助,當我有類似的問題安裝Bower)。

什麼是造成這些錯誤以及如何解決這個問題?

環境:使用Debian來賓系統和Windows 7主機系統的VirtualBox。

編輯

現在(我想以後我已經成功地執行npm install在非共享文件夾)我在歌廳不同的錯誤:

當我啓動虛擬機中常見的方法:

[email protected]:/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 [email protected] 
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 

當我啓動VM作爲Administrator

[email protected]:/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 [email protected] 
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 
+1

我沒有嘗試複製您的問題,但首先我想問你一個問題:你是否試圖使用'sudo'運行命令?因爲這行'npm ERR!請嘗試以root/Administrator身份再次運行此命令。似乎表明這一點。像'sudo npm install'可能就是解決方案。 – 2015-04-01 08:22:43

+0

我是Debian訪客系統上的'root'。我還在主機上以'Administrator'身份啓動了虛擬機。 – automatix 2015-04-01 08:26:51

+0

不確定,但在[這個答案](http://stackoverflow.com/a/23526288/4594377)和下面的評論中,他們建議使用一個額外的選項'--no-bin-link'。你說安裝Bower時遇到了問題,也許只是啓用符號鏈接是不夠的。 – 2015-04-01 08:43:24

回答

3

試試做sudo npm cache clean。但它看起來問題是Windows的路徑太長(260byte限制),所以你不能共享目錄。

我試過使用fenestrate但它沒有爲我工作。您可能還想檢查this entry

+0

謝謝你的回答。經過很多嘗試,終於奏效了。不知何故......我不記得了,我想,我用了一種解決方法,但不記得,究竟是什麼。無論如何,如果我再次遇到這個問題,我會嘗試解決您的問題並提供反饋。 – automatix 2015-04-24 11:40:58

9

好吧,我看到的解決辦法

sudo npm cache clean 

然後

sudo npm install -g grunt grunt-cli 

我這樣做是在MacOS

3

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

0

我面臨同樣的問題,我嘗試了所有在這裏建議沒有成功的選項。最後,我讀了一個地方,我應該有超級用戶權限,所以我做了

sudo -s 

它似乎已經解決了這個問題。

1

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

npm cache clean 
rm -rf node_modules 
npm install 

原來我有我的虛擬機上運行的磁盤空間不足。分配一些空間並運行上述命令後,所有操作都按預期工作。

+0

感謝您提供有關空間的提示。這裏同樣的問題。 – 2018-01-21 15:14:33

0

給我npm緩存清理沒有工作。 但是刪除有問題的目錄(npm刪除),然後只需重新安裝該軟件包!