gpt4 book ai didi

vue.js - Vue 创建项目 - 找不到模块 'vue-loader-v16/package.json'

转载 作者:行者123 更新时间:2023-12-04 01:15:32 30 4
gpt4 key购买 nike

我通过命令 npm install -g @vue/cli 在全局安装了 vue-cli 我尝试通过命令 vue create examples-vue-2 创建新项目一切正常,直到我运行 npm run serve。此命令向我抛出错误 Cannot find module 'vue-loader-v16/package.json'

我在 Win 10,npm 6.7.0,节点 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

包.json

{
"name": "examples-vue-2",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^3.0.0-0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0-0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}



非常感谢您的帮助。

最佳答案

这对我有用:

npm install --save-dev vue-loader-v16 

关于vue.js - Vue 创建项目 - 找不到模块 'vue-loader-v16/package.json',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63483195/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com