安装image-webpack-loader时NPM失败。我无法继续我的项目。

时间:2017-02-10 06:04:20

标签: npm webpack npm-install

Webpack整天都工作正常,当我添加新图片时,它突然失败了。我更新了节点和npm,但仍然出现以下错误。我将如何解决此问题或使用替代方案?我尝试安装的其他图像加载器模块也出现了同样的错误。

74857 verbose stack Error: gifsicle@3.0.4 postinstall: `node lib/install.js`
74857 verbose stack Exit status 1
74857 verbose stack     at EventEmitter.<anonymous> (C:\Users\mykod\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
74857 verbose stack     at emitTwo (events.js:106:13)
74857 verbose stack     at EventEmitter.emit (events.js:191:7)
74857 verbose stack     at ChildProcess.<anonymous> (C:\Users\mykod\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
74857 verbose stack     at emitTwo (events.js:106:13)
74857 verbose stack     at ChildProcess.emit (events.js:191:7)
74857 verbose stack     at maybeClose (internal/child_process.js:877:16)
74857 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
74858 verbose pkgid gifsicle@3.0.4
74859 verbose cwd C:\Users\mykod\Desktop\best-voted
74860 error Windows_NT 10.0.14393
74861 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mykod\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
74862 error node v6.9.4
74863 error npm  v4.3.0
74864 error code ELIFECYCLE
74865 error errno 1
74866 error gifsicle@3.0.4 postinstall: `node lib/install.js`
74866 error Exit status 1
74867 error Failed at the gifsicle@3.0.4 postinstall script 'node lib/install.js'.
74867 error Make sure you have the latest version of node.js and npm installed.
74867 error If you do, this is most likely a problem with the gifsicle package,
74867 error not with npm itself.
74867 error Tell the author that this fails on your system:
74867 error     node lib/install.js
74867 error You can get information on how to open an issue for this project with:
74867 error     npm bugs gifsicle
74867 error Or if that isn't available, you can get their info via:
74867 error     npm owner ls gifsicle
74867 error There is likely additional logging output above.
74868 verbose exit [ 1, true ]

2 个答案:

答案 0 :(得分:1)

重新启动对我没有帮助。我的笔记本电脑上的权限存在问题。 我正在使用Ubuntu 16.04。

以下是解决方案:fixing npm permissions

我建议先观看视频。 至少首先检查NPM的目录npm config get prefix,如果它 / usr ,则必须使用选项2

通过选项2 逐步处理,我解决了这个问题。

答案 1 :(得分:0)

我重新启动了计算机并能够安装它。视窗。