我正在配置一个实时web服务器,该服务器需要将npm run production作为部署后脚本运行。为了成功运行这个命令,我需要成功安装laravel-mix。在对laravel mix运行下面的install命令时,我收到一个无法解决的安装后错误。这对我来说是一个真正的拦截者。我很感谢任何关于如何解决的建议。
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发布于 2018-03-17 03:53:09
试一试
sudo rm -rf node_modules/
npm install如果有效的话,请告诉我。
https://stackoverflow.com/questions/49211380
复制相似问题