Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant run npm script, it shown "Error: spawn node_modules/webpack/bin/webpack.js EACCES"

I am trying to run my project on Linux Mint that I just installed and configured but when I run the npm run dev command. "spawn node_modules / webpack / bin / webpack.js EACCES" error appears.

I have tried all the methods provided on the internet such as reinstalling nodes, upgrading versions, clear cache nodes and deleting folders. but still error.

> @ dev /home/wirnat/Web/Bukasewa/bukasewa.vBETA
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

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

Error: spawn node_modules/webpack/bin/webpack.js EACCES
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: 'EACCES',
  code: 'EACCES',
  syscall: 'spawn node_modules/webpack/bin/webpack.js',
  path: 'node_modules/webpack/bin/webpack.js',
  spawnargs: [
    '--progress',
    '--hide-modules',
    '--config=node_modules/laravel-mix/setup/webpack.config.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `node node_modules/cross-env/dist/bin/cross-env.js 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 @ 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!     /home/wirnat/.npm/_logs/2019-10-17T12_37_01_854Z-debug.log 

"maybe this problem has to do with permission, but I'm just learning linux and don't really understand it."

like image 793
Wiranatha Avatar asked Apr 14 '26 15:04

Wiranatha


1 Answers

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

I just followed above steps and it worked.

like image 199
jisna Avatar answered Apr 16 '26 05:04

jisna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!