我正在学习vueJs,我已经使用CLI安装了我的项目,并且已经成功安装了项目,当我需要使用npm run serve命令通过终端运行我的项目时,问题就来了,以下是在运行vueJs之后发生的错误命令
$ npm运行发球
> school@0.1.0 serve C:\Users\Mr chomvu\Documents\vueproject\school
> vue-cli-service serve
INFO Starting development server...
ERROR Error: Cannot find module '@xtuc/long'
Error: Cannot find module '@xtuc/long'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Mr
chomvu\Documents\vueproject\school\node_modules\@webassemblyjs\wast-
printer\lib\index.js:10:36)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! school@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the school@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\Mr chomvu\AppData\Roaming\npm-cache\_logs\2019-
06-08T13_11_37_227Z-debug.log
I do expect after successfully compilation to have a local:
https://localhost:8080
我已附上错误图片:
答案 0 :(得分:0)
如果您没有在项目中进行任何更改,只需尝试安装并运行第一个vue.js应用程序,然后按照本指南Creating a Project CLI进行操作,一切都会好起来的。 确保使用最新版本的node&npm。
如果您要修复此项目,请尝试删除node_modules
和package-lock.json
文件,然后运行npm install