ubuntu - npm install laravel-mix 在 ubuntu 上失败 - 在 gifsicle 上安装后失败

标签 ubuntu npm ubuntu-16.04 laravel-mix

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

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

最佳答案

尝试

sudo rm -rf node_modules/
npm install

让我知道这是否有效。

关于ubuntu - npm install laravel-mix 在 ubuntu 上失败 - 在 gifsicle 上安装后失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49211380/

相关文章:

postgresql - Ubuntu 上的 Postgres 配置问题?

ubuntu - 在 Ubuntu 上,如何通过 apt-get 安装 pygtk for python 2.7?

javascript - 如何在 meteor 1.4.1.1 中使用 intro.js 形式的 npm 包?

angularjs - 如何在我的 Angular 应用程序中安装 underscore.js?

ubuntu - Go time.Ticker 在 Ubuntu 16.04 服务器上意外触发

linux - 如何在 Linux 上构建同时构建 32 位和 64 位代码的 gcc 编译器

python - 无法在 Ubuntu 16.04(64 位)上安装 Snap7 库

docker - 允许 Docker 容器和主机用户在绑定(bind)挂载主机目录上写入

node.js - npm "scripts": "start" run express and open url

linux - 如何安装特定版本的 libhwloc5