New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Mix npm run dev error #1072

Closed
HerrTxbias opened this Issue Jul 29, 2017 · 42 comments

Comments

Projects
None yet
@HerrTxbias

HerrTxbias commented Jul 29, 2017

  • Laravel Mix Version: 1.4.2 (npm list --depth=0)
  • Node Version (node -v): v8.2.1
  • NPM Version (npm -v): 5.3.0
  • OS: Debian 8

Description:

When I'm running the command npm run dev, I'm getting the following output with an error:

root@gra2-status:/var/www/webinterface# npm run dev

> @ dev /var/www/webinterface
> npm run development


> @ development /var/www/webinterface
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
    at exports._errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development 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!     /root/.npm/_logs/2017-07-29T07_18_17_185Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev 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!     /root/.npm/_logs/2017-07-29T07_18_17_205Z-debug.log

Steps To Reproduce:

Clean Laravel Installation (
composer create-project laravel/laravel webinterface)

  1. run: composer install
  2. run: npm install
  3. run: npm run dev
@JeffreyWay

This comment has been minimized.

Show comment
Hide comment
@JeffreyWay

JeffreyWay Aug 1, 2017

Owner

I just followed those steps, and everything worked correctly. Try doing a full reset:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
Owner

JeffreyWay commented Aug 1, 2017

I just followed those steps, and everything worked correctly. Try doing a full reset:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
@HerrTxbias

This comment has been minimized.

Show comment
Hide comment
@HerrTxbias

HerrTxbias Aug 1, 2017

Hey! I tried you commands and it worked. I've cleared the cache before too and deleted the node modules but it's good that it works now. Thank you!

HerrTxbias commented Aug 1, 2017

Hey! I tried you commands and it worked. I've cleared the cache before too and deleted the node modules but it's good that it works now. Thank you!

@HerrTxbias HerrTxbias closed this Aug 1, 2017

@therealSMAT

This comment has been minimized.

Show comment
Hide comment
@therealSMAT

therealSMAT Aug 10, 2017

Worked for me also. Thanks

therealSMAT commented Aug 10, 2017

Worked for me also. Thanks

@Apascualm

This comment has been minimized.

Show comment
Hide comment
@Apascualm

Apascualm Sep 6, 2017

Working. Thanks

Apascualm commented Sep 6, 2017

Working. Thanks

@ruchern

This comment has been minimized.

Show comment
Hide comment
@ruchern

ruchern Sep 7, 2017

Contributor

Related issue fixed. #1065 (comment)

Contributor

ruchern commented Sep 7, 2017

Related issue fixed. #1065 (comment)

@cristianmeza

This comment has been minimized.

Show comment
Hide comment
@cristianmeza

cristianmeza Sep 13, 2017

Thanks you @JeffreyWay working perfectly

cristianmeza commented Sep 13, 2017

Thanks you @JeffreyWay working perfectly

@NileshRamani

This comment has been minimized.

Show comment
Hide comment
@NileshRamani

NileshRamani Sep 18, 2017

Thanks, it's working for me also.

NileshRamani commented Sep 18, 2017

Thanks, it's working for me also.

@fulopattila122

This comment has been minimized.

Show comment
Hide comment
@fulopattila122

fulopattila122 Oct 19, 2017

These javascript tools tend to remind me to good old Windows:

  • are present everywhere
  • everybody uses them
  • they cannot be avoided
  • they throw seemingly random errors
  • no one knows the real cause of the errors
  • reset resolves them.

🎢

fulopattila122 commented Oct 19, 2017

These javascript tools tend to remind me to good old Windows:

  • are present everywhere
  • everybody uses them
  • they cannot be avoided
  • they throw seemingly random errors
  • no one knows the real cause of the errors
  • reset resolves them.

🎢

@rattfieldnz

This comment has been minimized.

Show comment
Hide comment
@rattfieldnz

rattfieldnz Nov 15, 2017

I sometimes get this when installing my Laravel projects for the first time, and in my Vagrant/VirtualBox VM (ubuntu/xenial64). @JeffreyWay's solution is what fixed everything for me :).

To add more info about my setup - I'm using this custom Vagrant/VirtualBox I created for a client's Silverstripe project a few months ago. While this version (at time of it's last commit) had only PHP5.6 and an older version of NodeJS, I have updated these since (at the time of typing this, my PHP version is 7.1.1 (PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 ) and NodeJS is v6.12.0. I also have PHP 7.2, but have disabled it for now as it was causing a weird bug with Laravel (for which I can't remember what it was).

rattfieldnz commented Nov 15, 2017

I sometimes get this when installing my Laravel projects for the first time, and in my Vagrant/VirtualBox VM (ubuntu/xenial64). @JeffreyWay's solution is what fixed everything for me :).

To add more info about my setup - I'm using this custom Vagrant/VirtualBox I created for a client's Silverstripe project a few months ago. While this version (at time of it's last commit) had only PHP5.6 and an older version of NodeJS, I have updated these since (at the time of typing this, my PHP version is 7.1.1 (PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 ) and NodeJS is v6.12.0. I also have PHP 7.2, but have disabled it for now as it was causing a weird bug with Laravel (for which I can't remember what it was).

@ypn

This comment has been minimized.

Show comment
Hide comment
@ypn

ypn Jan 6, 2018

Yeah. Thanks to @JeffreyWay . you saved my life.

ypn commented Jan 6, 2018

Yeah. Thanks to @JeffreyWay . you saved my life.

@vickvasquez

This comment has been minimized.

Show comment
Hide comment
@vickvasquez

vickvasquez commented Jan 15, 2018

Thanks man.

@irvv17

This comment has been minimized.

Show comment
Hide comment
@irvv17

irvv17 commented Jan 24, 2018

nice

@Hirokyn

This comment has been minimized.

Show comment
Hide comment
@Hirokyn

Hirokyn Jan 30, 2018

Thanks man, worked!

Hirokyn commented Jan 30, 2018

Thanks man, worked!

@LarrySul

This comment has been minimized.

Show comment
Hide comment
@LarrySul

LarrySul Feb 5, 2018

i dont get this solution , those it mean i will have to loose all my project if am installing over again

LarrySul commented Feb 5, 2018

i dont get this solution , those it mean i will have to loose all my project if am installing over again

@cleanboy

This comment has been minimized.

Show comment
Hide comment
@cleanboy

cleanboy Feb 5, 2018

@LarrySul no, you are just deleting node_modules and then putting it back essentially. as long as your package.json has the correct things in it then you will be back to where you were before this error

cleanboy commented Feb 5, 2018

@LarrySul no, you are just deleting node_modules and then putting it back essentially. as long as your package.json has the correct things in it then you will be back to where you were before this error

@Isaac009

This comment has been minimized.

Show comment
Hide comment
@Isaac009

Isaac009 Feb 8, 2018

Thank You Very Much.... It works perfectly.

Isaac009 commented Feb 8, 2018

Thank You Very Much.... It works perfectly.

@jbcksfrt

This comment has been minimized.

Show comment
Hide comment
@jbcksfrt

jbcksfrt Feb 28, 2018

Thanks as usual @JeffreyWay, but does anyone know how we were supposed to know that step was needed from the log output?

jbcksfrt commented Feb 28, 2018

Thanks as usual @JeffreyWay, but does anyone know how we were supposed to know that step was needed from the log output?

@neveena

This comment has been minimized.

Show comment
Hide comment
@neveena

neveena Mar 1, 2018

@JeffreyWay Thank you 👍 works 💃

neveena commented Mar 1, 2018

@JeffreyWay Thank you 👍 works 💃

@cleanboy

This comment has been minimized.

Show comment
Hide comment
@cleanboy

cleanboy Mar 1, 2018

So the steps @JeffreyWay posted work for me but every time I start my working day I have to go do the same steps again but only once (every time I start my machine) and it doesnt matter which project I do it on but once I do it its fine...its just that I have to do it every time i switch my pc on.

cleanboy commented Mar 1, 2018

So the steps @JeffreyWay posted work for me but every time I start my working day I have to go do the same steps again but only once (every time I start my machine) and it doesnt matter which project I do it on but once I do it its fine...its just that I have to do it every time i switch my pc on.

@yunusemreerken

This comment has been minimized.

Show comment
Hide comment
@yunusemreerken

yunusemreerken Mar 22, 2018

@JeffreyWay thanks bro. its worked thanks to you

yunusemreerken commented Mar 22, 2018

@JeffreyWay thanks bro. its worked thanks to you

@envision

This comment has been minimized.

Show comment
Hide comment
@envision

envision Mar 22, 2018

There was something wrong with my Laravel Mix + Spark + Voyager dependency list and couldn't get it working with npm install.

Using yarn install instead finally worked. Must have been fsevents dep ... here was the output:

yarn install
yarn install v1.5.1
info No lockfile found.
[1/4] Resolving packages...
warning highlight@0.2.4: Not maintained anymore
warning laravel-mix > img-loader > imagemin-gifsicle > gifsicle > bin-wrapper > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning webpack-cli > jscodeshift > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
warning webpack-cli > webpack-addons > jscodeshift > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
warning webpack-cli > jscodeshift > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
warning webpack-cli > webpack-addons > jscodeshift > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > vue-loader@14.2.1" has unmet peer dependency "css-loader@*".
warning " > webpack-cli@2.0.13" has incorrect peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 248.39s.

envision commented Mar 22, 2018

There was something wrong with my Laravel Mix + Spark + Voyager dependency list and couldn't get it working with npm install.

Using yarn install instead finally worked. Must have been fsevents dep ... here was the output:

yarn install
yarn install v1.5.1
info No lockfile found.
[1/4] Resolving packages...
warning highlight@0.2.4: Not maintained anymore
warning laravel-mix > img-loader > imagemin-gifsicle > gifsicle > bin-wrapper > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning webpack-cli > jscodeshift > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
warning webpack-cli > webpack-addons > jscodeshift > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
warning webpack-cli > jscodeshift > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
warning webpack-cli > webpack-addons > jscodeshift > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > vue-loader@14.2.1" has unmet peer dependency "css-loader@*".
warning " > webpack-cli@2.0.13" has incorrect peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 248.39s.
@aswinaryal

This comment has been minimized.

Show comment
Hide comment
@aswinaryal

aswinaryal Mar 26, 2018

installing libpng-dev solves problem in my ubuntu17.10

sudo apt-get install libpng-dev

aswinaryal commented Mar 26, 2018

installing libpng-dev solves problem in my ubuntu17.10

sudo apt-get install libpng-dev

@llhilton

This comment has been minimized.

Show comment
Hide comment
@llhilton

llhilton Mar 26, 2018

If something, somewhere in node_modules is requiring webpack 4 (babel-loader, maybe?), is there a way to force it to not? I've tried the things here, but I just keep getting the error.

llhilton commented Mar 26, 2018

If something, somewhere in node_modules is requiring webpack 4 (babel-loader, maybe?), is there a way to force it to not? I've tried the things here, but I just keep getting the error.

@jlnmay

This comment has been minimized.

Show comment
Hide comment
@jlnmay

jlnmay Mar 28, 2018

Thanks commands above worked for me.

jlnmay commented Mar 28, 2018

Thanks commands above worked for me.

@1n1t

This comment has been minimized.

Show comment
Hide comment
@1n1t

1n1t Apr 10, 2018

tried to run the commands above, didn't help. my log output:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/tom/.nvm/versions/node/v8.9.1/bin/node',
1 verbose cli   '/Users/tom/.nvm/versions/node/v8.9.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'development' ]
2 info using npm@5.5.1
3 info using node@v8.9.1
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle board_buddies@0.0.1~predevelopment: board_buddies@0.0.1
6 info lifecycle board_buddies@0.0.1~development: board_buddies@0.0.1
7 verbose lifecycle board_buddies@0.0.1~development: unsafe-perm in lifecycle true
8 verbose lifecycle board_buddies@0.0.1~development: PATH: /Users/tom/.nvm/versions/node/v8.9.1/lib/node_modules/npm/bin/node-gyp-bin:/Users/tom/web/board_buddies/node_modules/.bin:/Users/tom/.nvm/versions/n$
9 verbose lifecycle board_buddies@0.0.1~development: CWD: /Users/tom/web/board_buddies
10 silly lifecycle board_buddies@0.0.1~development: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle board_buddies@0.0.1~development: Returned: code: 2  signal: null
12 info lifecycle board_buddies@0.0.1~development: Failed to exec development script
13 verbose stack Error: board_buddies@0.0.1 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.j$
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/Users/tom/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/Users/tom/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid board_buddies@0.0.1
15 verbose cwd /Users/tom/web/board_buddies
16 verbose Darwin 17.4.0
17 verbose argv "/Users/tom/.nvm/versions/node/v8.9.1/bin/node" "/Users/tom/.nvm/versions/node/v8.9.1/bin/npm" "run" "development"
18 verbose node v8.9.1
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 2
22 error board_buddies@0.0.1 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 2
23 error Failed at the board_buddies@0.0.1 development script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

1n1t commented Apr 10, 2018

tried to run the commands above, didn't help. my log output:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/tom/.nvm/versions/node/v8.9.1/bin/node',
1 verbose cli   '/Users/tom/.nvm/versions/node/v8.9.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'development' ]
2 info using npm@5.5.1
3 info using node@v8.9.1
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle board_buddies@0.0.1~predevelopment: board_buddies@0.0.1
6 info lifecycle board_buddies@0.0.1~development: board_buddies@0.0.1
7 verbose lifecycle board_buddies@0.0.1~development: unsafe-perm in lifecycle true
8 verbose lifecycle board_buddies@0.0.1~development: PATH: /Users/tom/.nvm/versions/node/v8.9.1/lib/node_modules/npm/bin/node-gyp-bin:/Users/tom/web/board_buddies/node_modules/.bin:/Users/tom/.nvm/versions/n$
9 verbose lifecycle board_buddies@0.0.1~development: CWD: /Users/tom/web/board_buddies
10 silly lifecycle board_buddies@0.0.1~development: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle board_buddies@0.0.1~development: Returned: code: 2  signal: null
12 info lifecycle board_buddies@0.0.1~development: Failed to exec development script
13 verbose stack Error: board_buddies@0.0.1 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.j$
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/Users/tom/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/Users/tom/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid board_buddies@0.0.1
15 verbose cwd /Users/tom/web/board_buddies
16 verbose Darwin 17.4.0
17 verbose argv "/Users/tom/.nvm/versions/node/v8.9.1/bin/node" "/Users/tom/.nvm/versions/node/v8.9.1/bin/npm" "run" "development"
18 verbose node v8.9.1
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 2
22 error board_buddies@0.0.1 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 2
23 error Failed at the board_buddies@0.0.1 development script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
@simpledev

This comment has been minimized.

Show comment
Hide comment
@simpledev

simpledev Apr 15, 2018

Use Yarn instead works for me.

brew install yarn
sudo yarn install
npm run dev

It works

simpledev commented Apr 15, 2018

Use Yarn instead works for me.

brew install yarn
sudo yarn install
npm run dev

It works

@1n1t

This comment has been minimized.

Show comment
Hide comment
@1n1t

1n1t Apr 19, 2018

yeah, i fixed my eslint errors and it works.. kinda odd

1n1t commented Apr 19, 2018

yeah, i fixed my eslint errors and it works.. kinda odd

@zawyelwin

This comment has been minimized.

Show comment
Hide comment
@zawyelwin

zawyelwin commented Apr 23, 2018

Thanks @JeffreyWay .

@hosamalzagh

This comment has been minimized.

Show comment
Hide comment
@hosamalzagh

hosamalzagh Apr 30, 2018

not work centos 6

hosamalzagh commented Apr 30, 2018

not work centos 6

@zabaala

This comment has been minimized.

Show comment
Hide comment
@zabaala

zabaala May 25, 2018

Work fine for me.

zabaala commented May 25, 2018

Work fine for me.

@andrius103

This comment has been minimized.

Show comment
Hide comment
@andrius103

andrius103 May 25, 2018

For me the problem was fixed only after updating node and npm. Steps to fix if that is the case:

  1. update nodejs:
    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable
  2. restart machine (this was necessary, otherwise npm would not update correctly)
  3. update npm:
    sudo npm install npm -g
  4. npm install
  5. npm run dev

andrius103 commented May 25, 2018

For me the problem was fixed only after updating node and npm. Steps to fix if that is the case:

  1. update nodejs:
    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable
  2. restart machine (this was necessary, otherwise npm would not update correctly)
  3. update npm:
    sudo npm install npm -g
  4. npm install
  5. npm run dev
@bdjunayed

This comment has been minimized.

Show comment
Hide comment
@bdjunayed

bdjunayed May 26, 2018

Also worked for me.

bdjunayed commented May 26, 2018

Also worked for me.

@BonBonSlick

This comment has been minimized.

Show comment
Hide comment
@BonBonSlick

BonBonSlick May 27, 2018

Not working
This error for every action described above.
Nor installing new fresh lara, nor reinstalling, removing, updating, upgrading any version of lara, node, npm, yarn
yarn --version
1.6.0
node --version
v9.11.1
npm --version
6.1.0


bonbon@bonbons:/var/www/testtask$ rm -rf node_modules && rm package-lock.json && npm cache clean -f && npm i
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN notice [SECURITY] tunnel-agent has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=tunnel-agent&version=0.4.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

> node-sass@4.9.0 install /var/www/testtask/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/bonbon/.npm/node-sass/4.9.0/linux-x64-59_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /var/www/testtask/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.9.0 postinstall /var/www/testtask/node_modules/node-sass
> node scripts/build.js

Binary found at /var/www/testtask/node_modules/node-sass/vendor/linux-x64-59/binding.node
Testing binary
Binary is fine

> gifsicle@3.0.4 postinstall /var/www/testtask/node_modules/gifsicle
> node lib/install.js

  ✔ gifsicle pre-build test passed successfully

> mozjpeg@5.0.0 postinstall /var/www/testtask/node_modules/mozjpeg
> node lib/install.js

  ✔ mozjpeg pre-build test passed successfully

> optipng-bin@3.1.4 postinstall /var/www/testtask/node_modules/optipng-bin
> node lib/install.js

  ✔ optipng pre-build test passed successfully

> pngquant-bin@4.0.0 postinstall /var/www/testtask/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/var/www/testtask/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed
    at Promise.all.then.arr (/var/www/testtask/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pngquant-bin@4.0.0 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pngquant-bin@4.0.0 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/bonbon/.npm/_logs/2018-05-27T16_07_25_960Z-debug.log

Yarn answer


yarn install v1.6.0
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > img-loader > imagemin-mozjpeg > mozjpeg > bin-build > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[6/6] ⠁ node-sass: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.0/linux-x64-59_binding.node
[-/6] ⠁ waiting...
[-/6] ⠁ waiting...
[-/6] ⠁ waiting...
error /var/www/testtask/node_modules/pngquant-bin: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments: 
Directory: /var/www/testtask/node_modules/pngquant-bin
Output:
⚠ The `/var/www/testtask/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed

BonBonSlick commented May 27, 2018

Not working
This error for every action described above.
Nor installing new fresh lara, nor reinstalling, removing, updating, upgrading any version of lara, node, npm, yarn
yarn --version
1.6.0
node --version
v9.11.1
npm --version
6.1.0


bonbon@bonbons:/var/www/testtask$ rm -rf node_modules && rm package-lock.json && npm cache clean -f && npm i
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN notice [SECURITY] tunnel-agent has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=tunnel-agent&version=0.4.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

> node-sass@4.9.0 install /var/www/testtask/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/bonbon/.npm/node-sass/4.9.0/linux-x64-59_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /var/www/testtask/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.9.0 postinstall /var/www/testtask/node_modules/node-sass
> node scripts/build.js

Binary found at /var/www/testtask/node_modules/node-sass/vendor/linux-x64-59/binding.node
Testing binary
Binary is fine

> gifsicle@3.0.4 postinstall /var/www/testtask/node_modules/gifsicle
> node lib/install.js

  ✔ gifsicle pre-build test passed successfully

> mozjpeg@5.0.0 postinstall /var/www/testtask/node_modules/mozjpeg
> node lib/install.js

  ✔ mozjpeg pre-build test passed successfully

> optipng-bin@3.1.4 postinstall /var/www/testtask/node_modules/optipng-bin
> node lib/install.js

  ✔ optipng pre-build test passed successfully

> pngquant-bin@4.0.0 postinstall /var/www/testtask/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/var/www/testtask/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed
    at Promise.all.then.arr (/var/www/testtask/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pngquant-bin@4.0.0 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pngquant-bin@4.0.0 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/bonbon/.npm/_logs/2018-05-27T16_07_25_960Z-debug.log

Yarn answer


yarn install v1.6.0
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > img-loader > imagemin-mozjpeg > mozjpeg > bin-build > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[6/6] ⠁ node-sass: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.0/linux-x64-59_binding.node
[-/6] ⠁ waiting...
[-/6] ⠁ waiting...
[-/6] ⠁ waiting...
error /var/www/testtask/node_modules/pngquant-bin: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments: 
Directory: /var/www/testtask/node_modules/pngquant-bin
Output:
⚠ The `/var/www/testtask/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed

@jannejava

This comment has been minimized.

Show comment
Hide comment
@jannejava

jannejava Jun 5, 2018

If you are on Ubuntu try @aswinaryal answer

sudo apt-get install libpng-dev

jannejava commented Jun 5, 2018

If you are on Ubuntu try @aswinaryal answer

sudo apt-get install libpng-dev

@anilsahindev

This comment has been minimized.

Show comment
Hide comment
@anilsahindev

anilsahindev Jun 7, 2018

@ dev /Users/anlshn/newapp/try
npm run development

@ development /Users/anlshn/newapp/try
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

module.js:557
throw err;
^

Error: Cannot find module '/Users/anlshn/newapp/try/node_modules/laravel-mix/setup/webpack.config.js'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at requireConfig (/Users/anlshn/newapp/try/node_modules/webpack/bin/convert-argv.js:97:18)
at /Users/anlshn/newapp/try/node_modules/webpack/bin/convert-argv.js:104:17
at Array.forEach ()
at module.exports (/Users/anlshn/newapp/try/node_modules/webpack/bin/convert-argv.js:102:15)
at yargs.parse (/Users/anlshn/newapp/try/node_modules/webpack/bin/webpack.js:171:41)
at Object.Yargs.self.parse (/Users/anlshn/newapp/try/node_modules/yargs/yargs.js:533:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development 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! /Users/anlshn/.npm/_logs/2018-06-07T23_25_36_549Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev 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! /Users/anlshn/.npm/_logs/2018-06-07T23_25_36_641Z-debug.log

anilsahindev commented Jun 7, 2018

@ dev /Users/anlshn/newapp/try
npm run development

@ development /Users/anlshn/newapp/try
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

module.js:557
throw err;
^

Error: Cannot find module '/Users/anlshn/newapp/try/node_modules/laravel-mix/setup/webpack.config.js'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at requireConfig (/Users/anlshn/newapp/try/node_modules/webpack/bin/convert-argv.js:97:18)
at /Users/anlshn/newapp/try/node_modules/webpack/bin/convert-argv.js:104:17
at Array.forEach ()
at module.exports (/Users/anlshn/newapp/try/node_modules/webpack/bin/convert-argv.js:102:15)
at yargs.parse (/Users/anlshn/newapp/try/node_modules/webpack/bin/webpack.js:171:41)
at Object.Yargs.self.parse (/Users/anlshn/newapp/try/node_modules/yargs/yargs.js:533:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development 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! /Users/anlshn/.npm/_logs/2018-06-07T23_25_36_549Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev 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! /Users/anlshn/.npm/_logs/2018-06-07T23_25_36_641Z-debug.log

@doniisetiiawan

This comment has been minimized.

Show comment
Hide comment
@doniisetiiawan

doniisetiiawan Aug 8, 2018

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

Not work for me.

doniisetiiawan commented Aug 8, 2018

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

Not work for me.

@FarizF

This comment has been minimized.

Show comment
Hide comment
@FarizF

FarizF Aug 8, 2018

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

Not work for me.

Tried the above suggestion exactly several times (apart from the yarn.lock file part). Anyone got a suggestion for us?

2018-08-08T15_33_03_444Z-debug.log

FarizF commented Aug 8, 2018

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

Not work for me.

Tried the above suggestion exactly several times (apart from the yarn.lock file part). Anyone got a suggestion for us?

2018-08-08T15_33_03_444Z-debug.log

@doniisetiiawan

This comment has been minimized.

Show comment
Hide comment
@doniisetiiawan

doniisetiiawan Aug 9, 2018

Tried the above suggestion exactly several times (apart from the yarn.lock file part). Anyone got a suggestion for us?

2018-08-08T15_33_03_444Z-debug.log

Already fixed bro, my webpack configuration problem hehehe

doniisetiiawan commented Aug 9, 2018

Tried the above suggestion exactly several times (apart from the yarn.lock file part). Anyone got a suggestion for us?

2018-08-08T15_33_03_444Z-debug.log

Already fixed bro, my webpack configuration problem hehehe

@FPMedia

This comment has been minimized.

Show comment
Hide comment
@FPMedia

FPMedia Aug 16, 2018

Can you expand on that? Webpack configuration? @doniisetiiawan

Also tried everything above and not working
events.js:167
throw er; // Unhandled 'error' event
^

Error: spawn node_modules/webpack/dist/bin/webpack.js ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:230:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:266:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:236:12)
at onErrorNT (internal/child_process.js:407:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/dist/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

FPMedia commented Aug 16, 2018

Can you expand on that? Webpack configuration? @doniisetiiawan

Also tried everything above and not working
events.js:167
throw er; // Unhandled 'error' event
^

Error: spawn node_modules/webpack/dist/bin/webpack.js ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:230:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:266:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:236:12)
at onErrorNT (internal/child_process.js:407:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/dist/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

@eddyekofo94

This comment has been minimized.

Show comment
Hide comment
@eddyekofo94

eddyekofo94 Sep 6, 2018

Same error on WSL Ubuntu...

eddyekofo94 commented Sep 6, 2018

Same error on WSL Ubuntu...

@theshashiverma

This comment has been minimized.

Show comment
Hide comment
@theshashiverma

theshashiverma Sep 19, 2018

@JeffreyWay thanks man you save my life

theshashiverma commented Sep 19, 2018

@JeffreyWay thanks man you save my life

@mostafizr-com

This comment has been minimized.

Show comment
Hide comment
@mostafizr-com

mostafizr-com Sep 23, 2018

npm install webpack

mostafizr-com commented Sep 23, 2018

npm install webpack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment