javascript - babel-node is not recognized as internal or external command - Babel 7 - Stack Overflow

I'm using babel v7.6.x and have set up the following. package.json"scripts": {"dev&

I'm using babel v7.6.x and have set up the following.

package.json

 "scripts": {
    "dev": "nodemon --exec babel-node bin/index.js",
    "start": "babel-node bin/index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
...
"devDependencies": {
    "@babel/core": "^7.6.4",
    "@babel/node": "^7.6.3",
    "@babel/preset-env": "^7.6.3",
    "nodemon": "^1.19.4"
  }

.babelrc

{
    "presets":[
        "@babel/preset-env"
    ]
}

yet i am still getting :

'babel-node' is not recognized as an internal or external mand,
operable program or batch file.

It used to be working but since doing a recent npm install to get updated versions it has failed to start up successfully.

my node version is 10.15.2 npm version is 6.12.0

Thank you in advance!

I'm using babel v7.6.x and have set up the following.

package.json

 "scripts": {
    "dev": "nodemon --exec babel-node bin/index.js",
    "start": "babel-node bin/index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
...
"devDependencies": {
    "@babel/core": "^7.6.4",
    "@babel/node": "^7.6.3",
    "@babel/preset-env": "^7.6.3",
    "nodemon": "^1.19.4"
  }

.babelrc

{
    "presets":[
        "@babel/preset-env"
    ]
}

yet i am still getting :

'babel-node' is not recognized as an internal or external mand,
operable program or batch file.

It used to be working but since doing a recent npm install to get updated versions it has failed to start up successfully.

my node version is 10.15.2 npm version is 6.12.0

Thank you in advance!

Share Improve this question asked Dec 20, 2019 at 5:12 SyabsterSyabster 993 silver badges9 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

Remove package directory:

rm -rf node_modules

Install again:

yarn

or

npm install

Check there is no errors

Check enough free space available

Check existence of files:

  • node_modules/.bin/babel-node
  • node_modules/.bin/babel-node.cmd - windows only
  • node_modules/@babel/node/bin/babel-node.js

I have also run into the same problem. but found the problem might have been with the plugin versions i was using.

Check out this question

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745229218a4617602.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信