2017-08-13 142 views
1

最近我改變了我的環境從Windows 10到backbox linux 4.5.1,但我試圖用npm幾次安裝webpack。它永遠不會安裝它給出這些錯誤。任何幫助?Webpack不在Linux上安裝

verbose tar unpack /home/dove/.npm/webpack/1.12.13/package.tgz 
34 silly lockFile 27155615-tar-usr-lib-node-modules-webpack tar:///usr/lib/node_modules/webpack 
35 verbose lock tar:///usr/lib/node_modules/webpack /home/dove/.npm/27155615-tar-usr-lib-node-modules-webpack.lock 
36 silly lockFile 5c48f9fd--npm-webpack-1-12-13-package-tgz tar:///home/dove/.npm/webpack/1.12.13/package.tgz 
37 verbose lock tar:///home/dove/.npm/webpack/1.12.13/package.tgz /home/dove/.npm/5c48f9fd--npm-webpack-1-12-13-package-tgz.lock 
38 silly gunzTarPerm modes [ '775', '664' ] 
39 error Error: EACCES, mkdir '/usr/lib/node_modules/webpack' 
39 error { [Error: EACCES, mkdir '/usr/lib/node_modules/webpack'] 
39 error errno: 3, 
39 error code: 'EACCES', 
39 error path: '/usr/lib/node_modules/webpack', 
39 error fstream_type: 'Directory', 
39 error fstream_path: '/usr/lib/node_modules/webpack', 
39 error fstream_class: 'DirWriter', 
39 error fstream_stack: 
39 error [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23', 
39 error  '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53', 
39 error  'Object.oncomplete (fs.js:108:15)' ] } 
40 error Please try running this command again as root/Administrator. 
41 error System Linux 4.2.0-30-generic 
42 error command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "[email protected]" 
43 error cwd /home/dove/projects/yulu 
44 error node -v v0.10.37 
45 error npm -v 1.4.28 
46 error path /usr/lib/node_modules/webpack 
47 error fstream_path /usr/lib/node_modules/webpack 
48 error fstream_type Directory 
49 error fstream_class DirWriter 
50 error code EACCES 
51 error errno 3 
52 error stack Error: EACCES, mkdir '/usr/lib/node_modules/webpack' 
53 error fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23 
53 error fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53 
53 error fstream_stack Object.oncomplete (fs.js:108:15) 
54 verbose exit [ 3, true ] 
+0

我發現我想我不得不更新我的節點和NPM – henrybbosa

回答

1

我想問題是關於嘗試安裝npm沒有sudo權限,因爲它給了訪問錯誤。

「錯誤:EACCES,MKDIR '/ usr/lib目錄/ node_modules /的WebPack'」

你應該嘗試用 「命令」

須藤 「你的命令」

前綴運行命令

你也可以試試這個命令。 npm config set unsafe-perm = true

有一個關於github中這個錯誤的討論,你可能想看看。

https://github.com/Microsoft/BashOnWindows/issues/14