0
votes

i am trying to install babel watch after i have installed babel my json file is as follows

{
  "name": "t3",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "babel server.js --out-dir build",
    "dev-start": "babel-watch server.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  },
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-preset-env": "^1.7.0",
    "babel-watch": "^7.0.0"
  }
}

but i am getting this error while running npm run dev-start

[email protected] dev-start C:\Users\PRO\Desktop\t3 babel-watch server.js

internal/modules/cjs/loader.js:583 throw err; ^

Error: Cannot find module '@babel/core' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (C:\Users\PRO\Desktop\t3\node_modules\babel-watch\babel-watch.js:7:15) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] dev-start: babel-watch server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] dev-start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

1

1 Answers

0
votes

[Update] You might have update the babel. check out https://github.com/babel/babel/issues/8908 & How to upgrade to babel 7

Try

npm install @babel/core --save