R
R
Roman Chugunov2017-09-17 15:56:36
Node.js
Roman Chugunov, 2017-09-17 15:56:36

Webpack-dev-server: Permission denied, WTF???

Hello people)
Code at work and at home. Code on an external drive.
Once again I come home and continue to progat. But not at this time.
This time I was visited by the next misfortune.
I run webpack-dev-server and it throws an error:

[email protected] webpack-dev /media/ruut/MyDisk/Soft/Programming/MyProjects/JS/dpk
> webpack-dev-server --watch --progress --debug --hot --devtool eval-source-map --output-pathinfo --colors --inline --content-base public --port 8050 --host 127.0.0.1

sh: 1: webpack-dev-server: Permission denied

npm ERR! Linux 4.4.0-93-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "webpack-dev"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] webpack-dev: `webpack-dev-server --watch --progress --debug --hot --devtool eval-source-map --output-pathinfo --colors --inline --content-base public --port 8050 --host 127.0.0.1`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the [email protected] webpack-dev script 'webpack-dev-server --watch --progress --debug --hot --devtool eval-source-map --output-pathinfo --colors --inline --content-base public --port 8050 --host 127.0.0.1'.
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 dpk package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --watch --progress --debug --hot --devtool eval-source-map --output-pathinfo --colors --inline --content-base public --port 8050 --host 127.0.0.1
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs dpk
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls dpk
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /media/ruut/MyDisk/Soft/Programming/MyProjects/JS/dpk/npm-debug.log

I think: "Well lan, right now I'll write chmod 775 . -R" - Didn't help Oo
Then I deleted node_modules and npm cache clear && npm i - didn't help either. Ooooh
what kind of magic is that? How to solve this problem?
З,Ы, The disk is completely rw for the user.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Romanchenko, 2018-06-28
@romanchenkoalexey

I deleted the node_modules folder, then did npm install again and when I ran webpack ( npm run dev ) everything started fine, no error

C
cmpayc, 2019-06-11
@cmpayc

Perhaps this problem is with mounting the disk (it was mounted without execution rights). Find your device in the list via the "mount" command and check the execution permissions (exec). Try to mount manually with mount -o exec
For other cases, you need to find where the webpack-dev-server file is launched from.
- To install webpack-dev-server locally (without the -g flag), go to the ./node_modules/.bin folder and make sure the folder contains file links and not executables. Find where the webpack-dev-server file is referenced (probably ./node_modules/webpack-dev-server/bin/webpack-dev-server.js) and set permissions to 0755 on this file. If instead of links there are executable files, then most likely the folder was moved from another location. Delete the entire ./node_modules folder and re-install the packages (npm install).
- To install globally, look for webpack-dev-server in ~/.npm/.bin and also set the appropriate permissions
- When running through webpack-dev, find its location (which webpack-dev), open it in a text editor and try to find the folder from where the webpack-dev-server file is launched

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question