简体   繁体   中英

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 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, after that I'm getting error of Bebel-node. Any one can help me how can i solve this issue??b I have installed all bebal.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"
  }
}
 "start": "nodemon --exec npx babel-node src/index.js",

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM