我正在尝试使用引发此错误的sudo gulp
构建环境:
[14:22:36] 'scripts' errored after 12 ms
[14:22:36] Error: Cannot find module '@babel/core'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/ubuntu/armory_frontend/node_modules/gulp-babel/index.js:7:15)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
看来我有依赖问题,所以我添加了我的package.json
文件:
{
"private": true,
"engines": {
"node": ">=4"
},
"devDependencies": {
"amd-optimize": "^0.6.1",
"babel-cli": ">=6.24.1",
"babel-core": ">=6.4.0",
"babel-preset-env": ">=1.0.0",
"babel-preset-stage-2": ">=0.0.1",
"babel-preset-react": "^6.24.1",
"babel-register": ">=6.5.2",
"browser-sync": ">=2.2.1",
"chai": ">=3.5.0",
"del": ">=1.1.1",
"gulp": ">=3.9.0",
"gulp-autoprefixer": ">=3.1.0",
"gulp-babel": ">=6.1.1",
"gulp-cache": ">=0.4.2",
"gulp-concat": ">=2.6.0",
"gulp-cssnano": ">=2.0.0",
"gulp-eslint": ">=2.0.0",
"gulp-filter": ">=4.0.0",
"gulp-flatten": ">=0.3.0",
"gulp-htmlmin": ">=1.3.0",
"gulp-if": ">=2.0.0",
"gulp-imagemin": ">=2.2.1",
"gulp-load-plugins": ">=0.10.0",
"gulp-path": ">=3.0.3",
"gulp-plumber": ">=1.0.1",
"gulp-react": "^3.1.0",
"gulp-sass": ">=2.0.0",
"gulp-size": ">=1.2.1",
"gulp-sourcemaps": ">=1.5.0",
"gulp-uglify": ">=1.1.0",
"gulp-uglify-es": ">=1.0.0",
"gulp-useref": ">=3.0.0",
"gulp-util": ">=3.0.7",
"pump": ">=1.0.0",
"main-bower-files": ">=2.5.0",
"mocha": ">=2.5.3",
"uglify-es": ">=1.0.0",
"wiredep": ">=2.2.2"
},
"eslintConfig": {
"env": {
"es6": true,
"node": true,
"browser": true
},
"rules": {
"quotes": [
2,
"single"
]
}
},
"dependencies": {
"babel-eslint": "^7.2.3",
"babelify": "^7.3.0",
"bootstrap": "=4.0.0-alpha.6",
"browserify": "^14.4.0",
"eslint-plugin-react": "^7.1.0",
"fancybox-plus": "^1.3.8",
"flag-icon-css": ">=2.7.0",
"font-awesome": ">=4.6.3",
"gulp-notify": "^3.0.0",
"jquery.easing": "^1.4.1",
"json2csv": ">=3.7.3",
"jsx": "^0.9.89",
"modernizr": ">=3.0.0",
"nprogress": ">=0.2.0",
"open-sans-fontface": ">=1.4.0",
"prop-types": "^15.5.10",
"react": "^15.6.1",
"react-circular-progressbar": "^0.5.0",
"react-dom": "^15.6.1",
"react-edit-inline": "^1.0.8",
"resemblejs": ">=2.2.3",
"tether": ">=1.3.2",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"ws": "^3.2.0"
}
}
我已经读过babel有问题,如果它与我当前的配置有所不同,那么@babel/core
的模块名称会更改为babel-core
吗?
我的哪些套餐试图使用新的@babel/core
?
只需将@babel/core
添加到您的"devDependencies"
像那样:
"@babel/core": "^7.0.0",