question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack.js: Permission denied

See original GitHub issue

Not quite sure what is happening, as this was working at some stage on this machine with a previous version.

axios@0.15.3
bootstrap-sass@3.3.7
cross-env@3.2.4
jquery@3.2.1
laravel-mix@0.11.2
lodash@4.17.4
vue@2.2.6
  • Node Version: 7.9.0
  • NPM Version: 4.5.0
  • OS: Ubuntu (Vagrant/Homestead VM)

Description:

Getting the following on a brand new install of Laravel 5.4, no files changed or altered. Trying: npm run dev, also sudo npm run dev Also tried chmodd’ing the webpack file it’s complaining about. Installed via npm install --no-bin-links Have tried completely purging the node_modules and clearing the npm cache.

> @ dev /home/vagrant/webdev/laravel-test/testapp
> npm run development


> @ development /home/vagrant/webdev/laravel-test/testapp
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

/bin/sh: 1: node_modules/webpack/bin/webpack.js: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
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 126
npm ERR!
npm ERR! Failed at the @ development script '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! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     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! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

Debug Log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'development' ]
2 info using npm@4.5.0
3 info using node@v7.9.0
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle @~predevelopment: @
6 silly lifecycle @~predevelopment: no script for predevelopment, continuing
7 info lifecycle @~development: @
8 verbose lifecycle @~development: unsafe-perm in lifecycle true
9 verbose lifecycle @~development: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/webdev/laravel-test/testapp/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/webdev/laravel-test/testapp/node_modules/.bin:/home/vagrant/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin$
10 verbose lifecycle @~development: CWD: /home/vagrant/webdev/laravel-test/testapp
11 silly lifecycle @~development: Args: [ '-c',
11 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' ]
12 silly lifecycle @~development: Returned: code: 126  signal: null
13 info lifecycle @~development: Failed to exec development script
14 verbose stack Error: @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
14 verbose stack Exit status 126
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd /home/vagrant/webdev/laravel-test/testapp
17 verbose Linux 4.4.0-22-generic
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "development"
19 verbose node v7.9.0
20 verbose npm  v4.5.0
21 error code ELIFECYCLE
22 error errno 126
23 error @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
23 error Exit status 126
24 error Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the  package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls
24 error There is likely additional logging output above.
25 verbose exit [ 126, true ]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

98reactions
choyancommented, Nov 17, 2018

npm rebuild fixes my problem.

17reactions
JeffreyWaycommented, Apr 21, 2017

@gavinbenda Do you have cross-env installed locally? npm install cross-env -D

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission denied when we use npm start using webpack?
The user callcenter (which executes the script) probably has no access to the path required (/var/www/html). Check permissions on this folder.
Read more >
Permission denied when running npm dist - Stack Overflow
Try chmod 775 -R /Users/Alfred/React this will recursively change the permissions for all folders and files under /React.
Read more >
webpack.js: Permission denied · Issue #726 - GitHub
Tell the author that this fails on your system: npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack. js --progress --hide- ...
Read more >
"npm start" permission denied error: how to solve it?
So, to solve this issue all you have to do is: · Remove Node If in OSX run brew uninstall node · Delete...
Read more >
Why is my Node build running into a permission denied error?
ERROR in EACCES: permission denied, open '/tmp/build_xxx/node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js'. This could surface as permission errors ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found