Skip to content
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

webpack.js: Permission denied #726

Closed
gavinbenda opened this issue Apr 21, 2017 · 10 comments
Closed

webpack.js: Permission denied #726

gavinbenda opened this issue Apr 21, 2017 · 10 comments

Comments

@gavinbenda
Copy link

gavinbenda commented Apr 21, 2017

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 ]
@QWp6t
Copy link
Contributor

QWp6t commented Apr 21, 2017

Does it work if you run node on the host OS instead of within the VM?

@JeffreyWay
Copy link
Collaborator

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

@choyan
Copy link

choyan commented Nov 17, 2018

npm rebuild fixes my problem.

@devenpateldp
Copy link

if you are using mount drive check this option.

in /etc/fstab file add exec in the mount option, like this:

auto,user,exec,utf8,uid=1000,gid=1000,rw 0 0

@mcansky
Copy link

mcansky commented Sep 1, 2020

@devenpateldp thanks for your comment : it made me realise there was probably an issue with my separate mount and it fixed the issue

@devenpateldp
Copy link

Great!

@lautarochiavarino
Copy link

@devenpateldp you save my life! i love you a little.

@devenpateldp
Copy link

devenpateldp commented Sep 29, 2020 via email

@alexjavascript
Copy link

npm rebuild fixes my problem.

Yeah, thank you!

@Vinicius-Sa
Copy link

Vinicius-Sa commented Dec 24, 2022

Deploing on ubuntOS using docker and azure devops pipline. Locally the build and run it was working fine, but wen runing on azure pipelines i was getting this erro:

2022-12-24T03:12:17.9431866Z   > webpack --mode development --progress
2022-12-24T03:12:17.9432128Z   
2022-12-24T03:12:17.9522680Z   sh: 1: webpack: Permission denied

After updating my package.json with npm rebuild solved the error, thanks !!

{
  "name": "asp.net",
  "version": "1.0.0",
  "scripts": {
    "build": "npm rebuild && webpack --mode development --progress",
    "prod": "npm rebuild && webpack --mode production --progress"
  }

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

No branches or pull requests

9 participants