react-router-tutorial icon indicating copy to clipboard operation
react-router-tutorial copied to clipboard

Failed at the [email protected] start script 'webpack-dev-server --inline --content-base .'.

Open dwightware4 opened this issue 10 years ago • 20 comments

Hey I'm trying to run the tutorial but the startup script is failing. The error message says:

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 tutorial package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack-dev-server --inline --content-base .

I'm running npm v3.6.0 and Node v5.6.0, which I believe to be the most current versions. I've attached the full error log. Thanks!

npm-debug.txt

dwightware4 avatar Feb 13 '16 18:02 dwightware4

Stupid suggestion but do you happen to have another program or webpack-dev-server running on your port 8080? I got the exact same error log and errors until I realized I had a webpack-dev-server running already from a different program.

ksliu25 avatar Feb 13 '16 22:02 ksliu25

I had the same problem, turns out I had a Java process I didn't even know about listening on 8080. Assuming you are using OS X El Capitan, the following command will identify processes using that port.

sudo lsof -i :8080 | grep LISTEN

My fix was to manually specify a port in the start script within package.json. I'd suggest this change be made to the project as it isn't immedaitely clear that webpack-dev-server uses 8080 by default.

"start": "webpack-dev-server --port 3001 --inline --content-base ."

ThomPatterson avatar Feb 16 '16 18:02 ThomPatterson

Yeah that was it, I had nginx running on 8080. Changed the port in package.json to an available port and everything is spiffy. Closing the issue. Thanks!

dwightware4 avatar Feb 18 '16 02:02 dwightware4

I tried the given solution, there was no process running with 8080 port and also changed my port number but hard luck. Still facing the same problem. Any help?

vinitkantrod avatar Feb 26 '17 16:02 vinitkantrod

Try to put "module.exports = config;" at the end of webpack.config.js file. That might solve your problem

sagargajera avatar Apr 13 '17 07:04 sagargajera

@ThomPatterson "start": "webpack-dev-server --port 3001 --inline --content-base ." This was not fixed my problem.

sivathiru avatar May 17 '17 09:05 sivathiru

@sagargajera "Try to put "module.exports = config;" at the end of webpack.config.js file. That might solve your problem" - not fixed my problem.

sivathiru avatar May 17 '17 09:05 sivathiru

my-screen

sivathiru avatar May 17 '17 09:05 sivathiru

The same error. I use port 9154

ivanstnsk avatar May 20 '17 20:05 ivanstnsk

I'd check to see if there are other processes running on port 8080.

Try googling for other workarounds and if all else fails, if you have access to the tutorial's github repo, git clone it and npm install for the packages in their package.json . At the least, you can continue learning whatever framework you are learning by doing this and figure out the setup issues when you can get to it.

PJ-JustDoIt avatar Jun 02 '17 20:06 PJ-JustDoIt

Facing the same error. None of the above solutions worked in my case.

contact2aneesh avatar Jul 02 '17 10:07 contact2aneesh

None of the above solutions worked in my system.

silentC0der avatar Jul 13 '17 07:07 silentC0der

me too :(

hajarrhechchou avatar Jul 21 '17 15:07 hajarrhechchou

same issue.. nothing worked

ppchandra avatar Oct 04 '17 01:10 ppchandra

Nothing worked for me too.

techguybiswa avatar Oct 15 '17 05:10 techguybiswa

[solved] In order to solve this issue, first go to "config" folder and open "webpack.config.dev.js" file in a text editor then change "port: 8080" (in line 39) to another port number for example "port: 8085".

shmatapour avatar Oct 18 '17 11:10 shmatapour

Had the same error, run "npm install" fixed the issue although I had my packages in place already but this is how it worked out for me!!

azeyad avatar Nov 02 '17 17:11 azeyad

I did EVERYTHING, changed port too, this is the third day im stuck at this point, I just wanna cry now I did set up by my self, then stopped trusting my self used other sources, installed webpack and webpack-dev-server globally, locally, updated everything, etc... please help error

najdi123 avatar Nov 06 '17 07:11 najdi123

YOUR PROBLEM: You probably have older version of nodeJS. I tested installing Webpack on my computer with 5-6 months old nodeJS version and it showed the same error.

SOLUTION:

  1. Delete entire "node_modules" folder that you are currently using in your project folder
  2. Go to https://nodejs.org/en/download/https://nodejs.org/en/download/ and download a .MSI version of nodeJS for your system. Then install it.
  3. After installation you can check new nodeJS's version: node -v
  4. Install again webpack, webpack-dev-server, ... etc.
  5. Now it should be OK

ghost avatar Feb 14 '18 22:02 ghost

proble install

$ create-react-app firstapp

Creating a new React app in C:\users\anous\react\firstapp.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...

yarn add v1.10.1 [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "win32" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 6 new dependencies. info Direct dependencies ├─ [email protected] ├─ [email protected] └─ [email protected] info All dependencies ├─ [email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] └─ [email protected] Done in 355.04s.

Success! Created firstapp at C:\users\anous\react\firstapp Inside that directory, you can run several commands:

yarn start Starts the development server.

yarn build Bundles the app into static files for production.

yarn test Starts the test runner.

yarn eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

cd firstapp yarn start

Happy hacking!

anous@anous-PC MINGW64 /c/users/anous/react (master) $ npm start npm ERR! path C:\users\anous\react\package.json npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open 'C:\users\anous\react\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\anous\AppData\Roaming\npm-cache_logs\2018-10-08T22_38_49_755Z-debug.log

anous@anous-PC MINGW64 /c/users/anous/react (master)

bengagi avatar Oct 08 '18 22:10 bengagi