$ gulp
[18:09:47] Failed to load external module @babel/register
[18:09:47] Requiring external module babel-register
C:\users\astros\file\es6pro\node_modules\[email protected]@babel-core\lib\transformation\file\opti ons\build-config-chain.js:154
throw err;
^
SyntaxError: C:\users\astros\file\es6pro\.babelrc: Error while parsing JSON - Unexpected EOF at lin e 1 column 2 of the JSON5 data. Still to read: ""
at error (C:\users\astros\file\es6pro\node_modules\[email protected]@json5\lib\json5.js:56:25)
at word (C:\users\astros\file\es6pro\node_modules\[email protected]@json5\lib\json5.js:393:13)
at value (C:\users\astros\file\es6pro\node_modules\[email protected]@json5\lib\json5.js:493:56)
at Object.parse (C:\users\astros\file\es6pro\node_modules\[email protected]@json5\lib\json5.js:508:1 8)
at ConfigChainBuilder.addConfig (C:\users\astros\file\es6pro\node_modules\[email protected]@ba bel-core\lib\transformation\file\options\build-config-chain.js:150:65)
at ConfigChainBuilder.findConfigs (C:\users\astros\file\es6pro\node_modules\[email protected]@ babel-core\lib\transformation\file\options\build-config-chain.js:96:16)
at buildConfigChain (C:\users\astros\file\es6pro\node_modules\[email protected]@babel-core\lib \transformation\file\options\build-config-chain.js:61:13)
at OptionManager.init (C:\users\astros\file\es6pro\node_modules\[email protected]@babel-core\l ib\transformation\file\options\option-manager.js:354:58)
at compile (C:\users\astros\file\es6pro\node_modules\[email protected]@babel-register\lib\ node.js:103:45)
at loader (C:\users\astros\file\es6pro\node_modules\[email protected]@babel-register\lib\n ode.js:144:14)
The reason why
occurs above is because babelrc is empty
, in babelirc.js, write
//presets转成2015
//写法需安装cnpm install babel-preset-es2015 --save-dev
{
"presets":["es2015"]
}
ok
Read More:
- Gulp error report, assertionerror [err_ ASSERTION]: Task function must be specified
- Cannot find module ‘internal / util / types’ appears during gulp build
- Gulp Error: Cannot find module ‘jshint/src/cli’;
- Error reported by gulp: referenceerror: primordials is not defined
- After installing CodeBlocks, run the prompt: tried to run compiler executable ‘C: / / MinGW / bin / mingw32- gcc.exe ‘, but failed!
- Jupyter failed to run websocket error
- NPM run build failed to package err! Missing script: build
- Failed to add /run/systemd/ask-password to directory watch: No space left on device?
- Angular: Program ng failed to run No application is associated
- docker:Failed to add /run/systemd/ask-password to directory watch: No space left on device
- Go run error go run: cannot run non main package
- Error failed to compile with 1 errors after finding NPM run dev
- Cause analysis and solution of “SVN: e155009: failed to run the WC DB work queue associated with”
- Processing method of SVN error “failed to run the WC DB work queue associated with…”
- Error report set of unity: failed to unload “assets / animation / clips / run_ 5.anim”
- Solve the problem of Vue running error( process.env.NODE_ Env = =’production ‘) and error in plugin “gulp shell”“
- Maven failed to start component [standard engine [Tomcat] when using tomcat7 Maven plugin plug-in run
- Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project
- linux Run: initramfs unpacking failed:write error
- ERROR 11668 — [ restartedMain] o.s.boot.SpringApplication : Application run failed