node.jsbabeljsnodesnode-modules

how can i fix this issue 'babel-node' is not recognized as an internal or external command, operable program or batch file.?


I'm working on a node.js project. I have created this project by use Babel which was running fine in previous using node system.

I have updated node.js version in my system, but after that, I'm getting an error of Bebel-node.

Can anyone help me resolve this issue? I have installed all babel.js module.

I'm using code in bebel.rc
{
    "plugins": [
        "@babel/plugin-transform-runtime"
    ],
    "presets": [
        "@babel/env"
    ],
    "ignore": [
        "node_modules",
        "src/public"
    ]
}

this is my updated  package.json ....
{
  "name": "backend-buluckart-hashing.company",
  "version": "0.1.0",
  "description": "groffers-nepal",
  "main": "index.js",
  "scripts": {
    "start": "nodemon src/index.js --exec babel-node --presets @babel/env",
    "build": "babel src -d dist --source-maps inline --copy-files",
    "serve": "node dist/index.js",
    "sequelize": "sequelize"
  },
  "keywords": [],
  "author": "Ashutosh singh",
  "license": "ISC",
  "homepage": "",
  "nodemonConfig": {
    "ignore": [
      "src/public/*"
    ]
  },
  "devDependencies": {
    "@babel/cli": "^7.17.6",
    "@babel/core": "^7.17.5",
    "@babel/node": "^7.16.8",
    "@babel/plugin-transform-runtime": "^7.17.0",
    "@babel/preset-env": "^7.16.11",
    "nodemon": "^2.0.15"
  },
  "dependencies": {
    "@babel/runtime": "^7.17.2",
    "aws-sdk": "^2.700.0",
    "babel-upgrade": "^1.0.1",
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.18.3",
    "cookie-parser": "^1.4.3",
    "cors": "^2.8.5",
    "dateformat": "^3.0.3",
    "dotenv": "^8.0.0",
    "event-stream": "^4.0.1",
    "express": "^4.16.3",
    "express-handlebars": "^6.0.2",
    "express-sanitizer": "^1.0.5",
    "express-session": "^1.15.6",
    "helmet": "^3.15.1",
    "joi": "^14.3.0",
    "joi-date-extensions": "^1.2.0",
    "jsonwebtoken": "^8.3.0",
    "kue": "^0.11.1",
    "mailparser": "^3.4.0",
    "moment": "^2.24.0",
    "morgan": "^1.9.0",
    "multer": "^1.4.1",
    "multer-s3": "^2.9.0",
    "mysql": "^2.16.0",
    "mysql2": "^1.6.4",
    "passport": "^0.4.0",
    "passport-jwt": "^4.0.0",
    "passport-local": "^1.0.0",
    "qs": "^6.10.3",
    "radis": "^2.0.0",
    "razorpay": "^2.0.6",
    "react-bootstrap": "^2.1.2",
    "read-excel-file": "^5.2.26",
    "request": "^2.88.0",
    "rotating-file-stream": "^1.4.1",
    "sequelize": "^5.21.13",
    "sequelize-cli": "^6.4.1",
    "speakeasy": "^2.0.0",
    "stack-trace": "0.0.10",
    "twilio": "^3.72.0"
  }
}

Solution

  •  "start": "nodemon --exec npx babel-node src/index.js",