我遇到以下错误:
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '@babel/core'
和下面是我的package.json:
"dependencies": {
"@babel/cli": "^7.8.4",
"@babel/runtime": "^7.9.6",
"cookie-parser": "^1.4.5",
"debug": "~2.6.9",
"express": "~4.16.1",
"express-session": "^1.17.1",
"hbs": "~4.0.4",
"http-errors": "~1.6.3",
"mongoose": "^5.9.13",
"mongoose-paginate": "^5.0.3",
"morgan": "~1.9.1",
"multer": "^1.4.2",
"nodemailer": "^6.4.6",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/node": "^7.8.7",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@babel/register": "^7.9.0",
"babel-core": "^6.26.3",
"babel-loader": "^8.1.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"nodemon": "^2.0.3"
},
"babel": {
"presets": [
"@babel/preset-env"
],
"plugins": [
[
"@babel/transform-runtime"
]
]
}
我正在使用nodejs express。该代码可在我自己的PC上运行,但在服务器中出现错误。
我将不胜感激。
谢谢