Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Module build failed: Error: spawn ENOENT #229

Open
RicoLiu opened this issue Apr 10, 2020 · 2 comments
Open

Module build failed: Error: spawn ENOENT #229

RicoLiu opened this issue Apr 10, 2020 · 2 comments

Comments

@RicoLiu
Copy link

RicoLiu commented Apr 10, 2020

OS: Ubuntu 18.04.3

npm install error log:

ERROR in ./src/assets/music/img.png
Module build failed: Error: spawn /home/jenkins/workspace/upload_html5_industry_all/HTML5/industry/healthRecord/node_modules/mozjpeg/vendor/cjpeg ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:247:19)
    at onErrorNT (internal/child_process.js:429:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)
 @ ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-561de9de","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vux-loader/src/before-template-compiler-loader.js!./node_modules/vux-loader/src/template-loader.js!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/sleep-music/sleepMusicPlayerPanel.vue 1:178-224
 @ ./src/components/sleep-music/sleepMusicPlayerPanel.vue
 @ ./src/router/index.js
 @ ./src/main.js�[39m�[22m

How to fix it?

@SimonGolms
Copy link

I am actually using WSL on Windows on Ubuntu and had the same issue. It looks like I was able to solve it as follows.

  1. Install missing libraries (reference:cwebp-bin error on fresh install imagemin/cwebp-bin#31):
sudo apt-get update && sudo apt-get install -y libglu1
  1. New installation of all packages:
rm -rf node_modules && npm install
  1. In case the postinstall checks of cwebp-bin, gifsicle, mozjpeg, optipng-bin or pngquant-bin still fails or you get an webpack error running npm run build or npm run start try a rebuild of the packages (reference: Error: spawn ../node_modules/optipng-bin/vendor/optipng ENOENT imagemin/optipng-bin#84 (comment)):
npm rebuild

@RicoLiu
Copy link
Author

RicoLiu commented May 8, 2020

I am actually using WSL on Windows on Ubuntu and had the same issue. It looks like I was able to solve it as follows.

  1. Install missing libraries (reference:imagemin/cwebp-bin#31):
sudo apt-get update && sudo apt-get install -y libglu1
  1. New installation of all packages:
rm -rf node_modules && npm install
  1. In case the postinstall checks of cwebp-bin, gifsicle, mozjpeg, optipng-bin or pngquant-bin still fails or you get an webpack error running npm run build or npm run start try a rebuild of the packages (reference: imagemin/optipng-bin#84 (comment)):
npm rebuild

Thanks. it works

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants