vue-cli 3的项目,运行报错

锺伟志
2023-12-01

 

$ npm run serve

> vue-cource@0.1.0 serve D:\code\vue\vue-cource
> vue-cli-service serve

D:\code\vue\vue-cource\node_modules\_read-pkg@5.1.1@read-pkg\index.js:13
                ...options
                ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\code\vue\vue-cource\node_modules\_@vue_cli-service@3.7.0@@vue\cli-service\lib\Service.js:5:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-cource@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-cource@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lx\AppData\Roaming\npm-cache\_logs\2019-05-15T05_21_45_266Z-debug.log

 

解决方法:

1.先全局安装vue-cli3.0 

2.更新node版本

 

 

 类似资料: