Start Script Missing Error When Running Npm Start

npm ERR! Missing script, but the script is there when I run npm run?

For anyone who may find this useful:
I managed to solve it by putting node before listing the path to my script file, like so:"buildSwaggerFiles": "node projects/common/src/lib/buildSwaggerFiles.bat",

React: missing script: start

I can see you do have "start" script in your package.json

  "scripts": {
"start": "react-scripts start", <--- here
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

react-scripts is a set of scripts from the create-react-app starter pack.

You need to run npm start command in your terminal in order to run the app.

In common apps, the start script looks like so:

"start": "npx node index.js"

Where index.js can be also the server.js file

npm start - npm ERR! missing script: start

You are missing the entry start in the scripts section of your package.json. If you want to compile the file using npm start then, you should copy node-sass sass/main.scss css/style.css -w and paste it as a value for start. You can add any command you would like to execute as the value for start.

Having said that, if you do npm "compile:sass" it will compile your sass files if you don't want to change your package.json.

"scripts": {
...
"compile:sass": "node-sass sass/main.scss css/style.css -w",
"start": "node-sass sass/main.scss css/style.css -w"
},


Related Topics



Leave a reply



Submit