npm install laravel-mix在ubuntu上失败 - 在gifsicle上postinstall失败

时间:2018-03-10 16:26:27

标签: ubuntu npm ubuntu-16.04 laravel-mix

我正在配置一个需要运行npm run production作为后部署脚本的实时Web服务器。为了成功运行此命令,我需要成功安装laravel-mix。运行laravel mix的以下安装命令后,我收到一个我无法解决的postinstall错误。对我来说这是一个真正的阻碍者。我很感激有关如何解决的任何建议。

sudo npm i laravel-mix

> gifsicle@3.0.4 postinstall /my/path/node_modules/gifsicle
> node lib/install.js

module.js:545
    throw err;
    ^

Error: Cannot find module '/my/path/node_modules/gifsicle/lib/install.js'
    at Function.Module._resolveFilename (module.js:543:15)
    at Function.Module._load (module.js:470:25)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:666:3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gifsicle@3.0.4 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gifsicle@3.0.4 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2018-03-10T16_22_00_506Z-debug.log

1 个答案:

答案 0 :(得分:0)

尝试

sudo rm -rf node_modules/
npm install

让我知道这是否有效。