Del*_*lon 7 javascript node.js npm vue.js
我的vue项目运行顺利。
我对我的组件之一进行了文件名更改,但出现错误。我修复了代码并使用 npn runserve 重新启动了 npm 服务器。
那是我收到错误的时候:
This dependency was not found:
* vue in ./src/main.js
* router in ./src/vue-router
Run Code Online (Sandbox Code Playgroud)
我设法通过运行使路由器再次工作
npm npm i -D @vue/vue-router
Run Code Online (Sandbox Code Playgroud)
我无法让 vue 再次工作。我试过了
npm install --save vue
Run Code Online (Sandbox Code Playgroud)
但这不起作用。我猜这是我的 webpack 配置中的引用错误或类似的错误,但我不知道如何修复它。
我的 main.js 中的代码如下所示:
import { createApp } from "vue";
import App from "./App.vue";
import router from "vue-router";
Run Code Online (Sandbox Code Playgroud)
我认为这是标准并且运行良好。
非常感谢您的帮助,因为我的所有开发都因此停止了。
更新
经过一番摆弄和重新安装后我已经到了这个阶段
你好,我已经添加了compiler-sfc,目前,我的package.json看起来像这样:见下文
我还删除了我的node_modules文件夹并使用再次安装它们
npm install
Run Code Online (Sandbox Code Playgroud)
但是,我仍然收到此错误:
Vue packages version mismatch:
- vue@3.0.11 (/Users/delon/Documents/webdev/Vue/amplify_vue3/node_modules/vue/index.js)
- vue-template-compiler@2.6.12 (/Users/delon/Documents/webdev/Vue/amplify_vue3/node_modules/vue-template-compiler/package.json)
This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
Run Code Online (Sandbox Code Playgroud)
{
"name": "amplify_vue3",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"@aws-amplify/ui-components": "^1.2.0",
"@vuelidate/core": "*",
"@vuelidate/validators": "*",
"aws-amplify": "^3.3.27",
"core-js": "^3.12.1",
"vue": "^3.0.11",
"vue-loader": "^16.2.0",
"vue-router": "^4.0.0-0",
"vuelidate": "^0.7.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "^3.0.5",
"@vue/compiler-sfc": "^3.0.11",
"css-loader": "^5.2.6",
"file-loader": "^1.1.11",
"mini-css-extract-plugin": "^0.4.5"
}
}
Run Code Online (Sandbox Code Playgroud)
我似乎找不到导致问题的参考。
归档时间: |
|
查看次数: |
1728 次 |
最近记录: |