Vue.js Vue创建项目-找不到模块';vue-loader-v16/package.json';
我通过命令Vue.js Vue创建项目-找不到模块';vue-loader-v16/package.json';,vue.js,npm,vue-cli,Vue.js,Npm,Vue Cli,我通过命令npm install-g@vue/cli全局安装了vue cli,并尝试通过命令vue create examples-vue-2创建新项目,直到运行npm run serve为止,一切正常。此命令引发错误无法找到模块“vue-loader-v16/package.json” 我在Win 10,npm 6.7.0,node 11.15.0上 这是整个控制台日志 λ npm run serve
npm install-g@vue/cli
全局安装了vue cli,并尝试通过命令vue create examples-vue-2
创建新项目,直到运行npm run serve
为止,一切正常。此命令引发错误无法找到模块“vue-loader-v16/package.json”
我在Win 10,npm 6.7.0,node 11.15.0上
这是整个控制台日志
λ npm run serve
> examples-vue-2@0.1.0 serve c:\wamp64-3-2-0\www\examples-vue-2
> vue-cli-service serve
INFO Starting development server...
ERROR Error: Cannot find module 'vue-loader-v16/package.json'
Error: Cannot find module 'vue-loader-v16/package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
at Function.Module._load (internal/modules/cjs/loader.js:591:27)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at api.chainWebpack.webpackConfig (c:\wamp64-3-2-0\www\examples-vue-2\node_modules\@vue\cli-service\lib\config\base.js:114:23)
at webpackChainFns.forEach.fn (c:\wamp64-3-2-0\www\examples-vue-2\node_modules\@vue\cli-service\lib\Service.js:236:40)
at Array.forEach (<anonymous>)
at Service.resolveChainableWebpackConfig (c:\wamp64-3-2-0\www\examples-vue-2\node_modules\@vue\cli-service\lib\Service.js:236:26)
at Service.resolveWebpackConfig (c:\wamp64-3-2-0\www\examples-vue-2\node_modules\@vue\cli-service\lib\Service.js:240:48)
at PluginAPI.resolveWebpackConfig (c:\wamp64-3-2-0\www\examples-vue-2\node_modules\@vue\cli-service\lib\PluginAPI.js:132:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! examples-vue-2@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the examples-vue-2@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\vladi\AppData\Roaming\npm-cache\_logs\2020-08-19T08_20_22_147Z-debug.log
非常感谢您的帮助。解决方案就在这个vue cli包问题中 您可能需要更新npm版本以安装丢失的软件包。这对我很有用:
npm install --save-dev vue-loader-v16
您可以安装模块以尝试修复它。你也可以分享你的package.json吗?package.json就在那里。我发现这个问题解决了这个问题
npm install --save-dev vue-loader-v16