2

I have a project that I cannot run npm start on.

I haven't touched this project in two weeks. The only thing I did yesterday was add a git repository, that's it.

When I tried to run npm start I got this error:

sh: react-scripts-start: command not found

npm ERR! file sh

npm ERR! code ELIFECYCLE

npm ERR! errno ENOENT

npm ERR! syscall spawn

npm ERR! [email protected] start: 'react-scripts-start'

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.

I've looked at the solutions on other posts about this same error but none work for me. I've deleted the node_modules directory and package-lock.json files, then ran npm install.

However, I still get the same error message. Does anyone know what's wrong?

This is my package.json file:

{
  "name": "bk-react-replica",
  "version": "0.1.0",
  "private": true,
  "homepage": "http://qhafeezdomain.dreamhosters.com/projects/bkreplica",
  "dependencies": {
    "antd": "^3.3.0",
    "normalize.css": "^8.0.0",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-native-scripts": "^1.13.1",
    "react-redux": "^5.0.7",
    "react-router-dom": "^4.2.2",
     "react-scripts": "^1.1.4",
    "react-scripts-cssmodules": "^1.0.171",
    "redux": "^3.7.2"
  },
  "scripts": {
    "start": "react-scripts-start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}
4
  • can you update your question with your package.json Commented Apr 18, 2018 at 17:49
  • @antzshrek i've added the package.json file Commented Apr 18, 2018 at 17:56
  • 1
    should "react-scripts-start" be "react-scripts start"? remove the last - Commented Apr 18, 2018 at 18:10
  • @davidhu2000 yes, that was the issue. Thanks! Commented Apr 18, 2018 at 18:33

1 Answer 1

2

As I will reference you to an answer I provided to a question similar to yours, run this:

 npm i -g npm //which will update npm
 rm -rf node_modules/ && npm cache clean // to remove the existing modules and clean the cache.
 npm install //to re-install the project dependencies.

Edited:

I just noticed your package.json it should be:

  "scripts": {
    "start": "react-scripts start",

not

  "scripts": {
    "start": "react-scripts-start",
Sign up to request clarification or add additional context in comments.

1 Comment

Happy to know that I could be of help to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.