Nodemon, babel-node is not recognized as an internal or external command, operable program or batch file

Viewed 108

I have been trying to initiate the localhost with npm start but getting this error in terminal:

[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): backend\**\*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `babel-node backend/server.js`
'babel-node' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...

The package.json in the root folder is:

{
  "name": "abc",
  "version": "1.0.0",
  "description": "ABC",
  "main": "index.js",
  "scripts": {
    "start": "nodemon --watch backend --exec babel-node backend/server.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cors": "^2.8.5",
    "express": "^4.17.3"
  },
  "devDependencies": {
    "@babel/cli": "^7.10.3",
    "@babel/core": "^7.10.3",
    "@babel/node": "^7.10.3",
    "@babel/preset-env": "^7.10.3",
    "nodemon": "^2.0.4"
  }
}

I also have these files in the node_modules.

  • node_modules/.bin/babel-node

  • node_modules/.bin/babel-node.cmd

  • node_modules/@babel/node/bin/babel-node.js

I just started working in node and cannot figure out how to solve this. Thanks in Advance.

0 Answers
Related