如果我在我的 macbook 上創建一個新的 vue.js 專案并使用“npm run serve”編譯它,我會收到以下錯誤。
自創建以來我沒有更改任何檔案。
markus@Markuss-MBP meinerstesprojekt % npm run serve
> meinerstesprojekt@0.1.0 serve
> vue-cli-service serve
INFO Starting development server...
ERROR Failed to compile with 1 error 6:12:51 PM
error
Conflict: Multiple assets emit different content to the same filename index.html
ERROR in Conflict: Multiple assets emit different content to the same filename index.html
webpack compiled with 1 error
vue.config.js
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})
module.exports = {
chainWebpack: (config) => {
config.resolve.symlinks(true)
}
}
包.json
{
"name": "meinerstesprojekt",
"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.8.3",
"vue": "^2.6.14"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "^5.0.1",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"vue-template-compiler": "^2.6.14"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
npm 版本:8.5.3
節點版本:v16.14.0
Vue 版本:@vue/cli 5.0.1
以下檔案夾位于路徑中:
├── README.md
├── babel.config.js
├── dist
├── jsconfig.json
├── node_modules
├── package-lock.json
├── package.json
├── public
├── src
└── vue.config.js
你知道為什么這不起作用嗎?不幸的是,我無法通過搜索網路找到解決方案
uj5u.com熱心網友回復:
當您點擊vue create your-project-nameSelect ([Vue 3] babel,eslint) 并嘗試npm run serve.
您還可以使用它vue ui來啟動一個新專案或匯入舊專案,并在瀏覽器的 GUI 中查看有關您專案的所有內容,以便您找出任何問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/442286.html
上一篇:如何解決這個npmi問題?
