element-ui 使用 npm run dev 启动失败;错误信息是: PS C:\workspase\web> npm run dev
[email protected] dev C:\workspase\web vue-cli-service serve
INFO Starting development server...
10% building 2/2 modules 0 active ERROR SyntaxError: Cannot use import statement outside a module
C:\workspase\web\mock\index.js:1
import "core-js/modules/es6.regexp.constructor";
at Server.setupAfterFeature (C:\workspase\web\node_modules\webpack-dev-server\lib\Server.js:439:18)
at Object.after (C:\workspase\web\node_modules\webpack-dev-server\lib\Server.js:499:16)
at C:\workspase\web\node_modules\webpack-dev-server\lib\Server.js:558:24
at Array.forEach (<anonymous>)
at Server.setupFeatures (C:\workspase\web\node_modules\webpack-dev-server\lib\Server.js:557:49)
at new Server (C:\workspase\web\node_modules\webpack-dev-server\lib\Server.js:133:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
有大神遇到过这个问题吗?求解答</anonymous>
1
arrow8899 2019-10-29 15:17:10 +08:00
升级下 nodejs 版本
|