尝试运行npm run serve时出现错误。 首先,我尝试在laravel项目中使用vue并运行“ npm run serve命令”。 之后,我卸载了vue以及vue / cli,然后再次重新安装它们。然后,我在独立文件夹中创建了新的vue项目。但是,当我尝试以-> npm run serve的身份运行服务器时,遇到的错误与在laravel项目中尝试过的错误相同。
我使用以下代码进行安装:
npm run serve => the vue and laravel project
npm run dev => the laravel project
这是错误:
$ npm run serve
vue-1@0.1.0 serve P:\codes & projects\vue\Tutorials\vue-1
vue-cli-service serve
'projects\vue\Tutorials\vue-1\node_modules\.bin\' is not recognized as an intern
al or external command,
operable program or batch file.
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'P:\@vue\cli-service\bin\vue-cli-service.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js
:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-1@0.1.0 serve: vue-cli-service serve**
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-1@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ahmad\AppData\Roaming\npm-cache\_logs\2020-09-13T16_12_03_
919Z-debug.log
这是bash终端中错误的图像: