我开始了角应用通过npm开始与吞咽/babel启用。启动后,浏览器页继续加载并抛出一个“需要外部babel寄存器”的错误。
来自航站楼的日志如下:
[19:52:47] Requiring external module @babel/register
[19:52:53] Using gulpfile ~\WebstormProjects\agent-dealer-portal-frontend\portals-integration\front\gulpfile.babel.js
[19:52:53] Starting 'default'...在终端中正确地列出了babel寄存器。
C:\Users\vramanathan\WebstormProjects\agent-dealer-portal-frontend\portals-integration\front>npm list babel-register
@globant/cna_national_portal@0.35.0 C:\Users\vramanathan\WebstormProjects\agent-dealer-portal-frontend\portals-integration\front
`-- babel-cli@6.26.0
+-- babel-core@6.26.3
| `-- babel-register@6.26.0 deduped
`-- babel-register@6.26.0.babelrc文件内容:
{
"presets": [
"es2015"
]
}Package.json:
{
"main": "gulpfile.babel.js",
"name": "@globant/cna_national_portal",
"version": "00.35.00",
"babel": {
"presets": [
"@babel/env"
],
"compact": false
},
......
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/register": "^7.5.5",
"babel-cli": "^6.26.0",
"babel-preset-es2015": "^6.18.0",
"del": "^3.0.0",
"eslint": "^5.0.1",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^3.1.1",
"gulp-babel": "^6.1.2",
"gulp-cli": "^1.4.0",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.2",
"gulp-eslint": "^4.0.2",
"gulp-header": "^1.8.9",
"gulp-if": "^2.0.2",
"gulp-imagemin": "^2.4.0",
"gulp-load-plugins": "^1.4.0",
"gulp-ng-annotate": "^2.0.0",
"gulp-rev": "^8.1.1",
"gulp-rev-replace": "^0.4.4",
"gulp-sass": "^3.1.0",
"gulp-sass-glob": "^1.0.8",
"gulp-sourcemaps": "^1.11.0",
"gulp-uglify": "^1.5.4",
"gulp-uncss": "^1.0.6",
},
"private": true,
"scripts": {
"start": "gulp",
"build": "gulp build --production",
"test": "gulp test",
"test:watch": "gulp test:watch",
"eslint": "gulp eslint"
}
}发布于 2019-11-07 16:37:13
following可能是有用的:当使用不同的操作系统时,某些版本的Node / gulp之间会出现一些不兼容的地方(我在Chromebook上工作)。
对我来说,将降级为Node 10解决了我的问题(通过命令):nvm use 10
https://stackoverflow.com/questions/57156138
复制相似问题