135

I am trying to start a Redux application I just cloned from a GitHub repository.

I tried to run it with the following command

npm start

I am getting this error

> [email protected] start /home/workspace/assignment
> webpack-dev-server --config ./configs/webpack/webpack.config.development.js

sh: 1: webpack-dev-server: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: `webpack-dev-server --config ./configs/webpack/webpack.config.development.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2018-05-15T16_32_44_571Z-debug.log

Any help will be appreciated

1
  • 2
    Every time I get an upvote on this question it reminds me of "how basic step it was". But again I was new with node and it knowing a lot of new devs need this (perhaps experienced ones too ;P) it feels good :D Nov 22, 2021 at 9:19

5 Answers 5

264

npm start runs a script that the app maker built for easy starting of the app npm install installs all the packages in package.json

run npm install first

then run npm start

2
  • Tried this. Immediately get npm ERR! 403 403 Forbidden - PUT https://<my-private-registry>/repository/npm-private/ts-acoustics npm ERR! 403 In most cases, you or one of your dependencies are requesting npm ERR! 403 a package version that is forbidden by your security policy. no node-module folder created and I am logged in. Nov 7 at 9:55
  • 1
    your error is self explanatory. you have a package in your package.json that is not allowed due to your own security policy. Be careful about installing packages you find across the internet.
    – Dan
    Nov 7 at 20:31
1

Just had the same error message, but when I was running a package.json with:

"scripts": {
    "build": "tsc -p ./src",
}

tsc is the command to run the TypeScript compiler.

I never had any issues with this project because I had TypeScript installed as a global module. As this project didn't include TypeScript as a dev dependency (and expected it to be installed as global), I had the error when testing in another machine (without TypeScript) and running npm install didn't fix the problem. So I had to include TypeScript as a dev dependency (npm install typescript --save-dev) to solve the problem.

1
  • 1
    Adding TS as a dev dependency worked for me, thanks! I trigger a build with tsc in the postinstall script, so that my TS app builds and deploys properly on Heroku. Apr 19, 2021 at 3:32
0

This issue can also raise when you change your system password but not the same updated on your .npmrc file that exist on path C:\Users\user_name, so update your password there too.

please check on it and run npm install first and then npm start.

-1

Working in Grapesjs and get the same error

goto package.json file and check dependencies

  1. Removing unused plugins or unused libraries.

  2. npm install

  3. npm start

Sometimes not useful install plugins get errors.

-3

Use npm install to install the package. I was having a permission issue with running this, due to the closed-nature of my office VPN. This'll solve permission problems...

sudo npm install

In some cases with permissions, when this fails, it emits no error message. In that case, you may want to adjust user permissions with either chown or chmod. Other times, though, when it fails, you'll actually see a legit error message...

npm ERR! network tunneling socket could not be established, statusCode=400

npm ERR! network This is most likely not a problem with npm itself

npm ERR! network and is related to network connectivity.

1
  • Caution: Using sudo with package managers can get you into trouble. Fix the permissions instead.
    – robrecord
    Jul 12 at 14:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.