0

can't run the npm start command. npm start is not recognized as a command . even though the json file is correct

  "name": "backend",
  "version": "1.0.0",
  "description": "backend express api for railway management",
  "main": "server",
  "scripts": {
    "start": "node server.js",
    "test": "echo \"Error: no test specified\" && exit 1",
    "server": "nodemon server"
  },
  "author": "Hiridharan",
  "license": "ISC",
  "dependencies": {
    "cookie-parser": "^1.4.5",
    "cors": "^2.8.5",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^5.11.9",
    "nodemon": "^2.0.6",
    "uuid": "^8.3.2"
  },
  "devDependencies": {}
}

i tried verifying the package.json but it is correct i cannot find why this error happens

1 Answers1

1

There can be 2 issues.

  • You don’t have Node installed on the machine, so npm is not recognized and raises some errors.
  • You don't have Node in your $PATH ENV Variable, which is why the machine cannot recognize npm commands.