错误:找不到模块“ @ babel / runtime / regenerator”

时间:2020-07-07 11:06:47

标签: node.js node-modules

大家好,当我将其构建用于生产并部署到服务器时,在节点应用程序上遇到此错误。服务器操作系统是ubuntu。

10|graphql | at Module. (/root/blonk-api-v2/app.js:1:3572)
10|graphql | at t (/root/blonk-api-v2/app.js:1:110)
10|graphql | at /root/blonk-api-v2/app.js:1:903
10|graphql | at Object. (/root/blonk-api-v2/app.js:1:913)
10|graphql | Error: Cannot find module '@babel/runtime/regenerator'
10|graphql | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
10|graphql | at Function.Module._load (internal/modules/cjs/loader.js:562:25)
10|graphql | at Module.require (internal/modules/cjs/loader.js:692:17)
10|graphql | at require (internal/modules/cjs/helpers.js:25:18)
10|graphql | at Object. (/root/blonk-api-v2/app.js:1:939)
10|graphql | at t (/root/blonk-api-v2/app.js:1:110)
10|graphql | at Module. (/root/blonk-api-v2/app.js:1:3572)
10|graphql | at t (/root/blonk-api-v2/app.js:1:110)
10|graphql | at /root/blonk-api-v2/app.js:1:903
10|graphql | at Object. (/root/blonk-api-v2/app.js:1:913)

这是我的package.json

{
"name": "graphql-api",
"version": "2.0.0",
"description": "New API using GraphQL",
"main": "app.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "nodemon --exec babel-node app.js",
"build-dev": "rm -rf dist && webpack --mode development",
"build-prod": "rm -rf dist && webpack --mode production"
},
"author": "Faisal Hussain",
"license": "ISC",
"dependencies": {
"@babel/runtime": "^7.10.4",
"@hapi/joi": "^15.1.1",
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"graphql": "^15.1.0",
"graphql-merge-resolvers": "^1.1.16",
"handlebars": "^4.7.6",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.9.18",
"mongoose-autopopulate": "^0.12.2",
"multer": "^1.4.2",
"nodemailer": "^6.4.10",
"nodemailer-mailgun-transport": "^2.0.0",
"regenerator-runtime": "^0.13.5",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-node-externals": "^1.7.2"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
"@babel/core": "^7.10.3",
"@babel/node": "^7.10.3",
"@babel/plugin-transform-async-to-generator": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.3",
"@babel/polyfill": "^7.10.1",
"@babel/preset-env": "^7.10.3",
"babel-loader": "^8.1.0",
"nodemon": "^2.0.4"
}
}

我已经安装了nvm。我尝试使用8.17.0和10.19.0版的节点。

NPM版本= 6.14.5

期待您的回答和建议。 TIA

0 个答案:

没有答案
相关问题