欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue3-vite安裝后main.ts文件和tsconfig.app.json文件報(bào)錯(cuò)解決辦法

 更新時(shí)間:2023年12月19日 09:27:22   作者:零OO  
Vue.js是一個(gè)流行的JavaScript框架,它可以幫助開(kāi)發(fā)者構(gòu)建交互式Web應(yīng)用程序,這篇文章主要給大家介紹了關(guān)于vue3-vite安裝后main.ts文件和tsconfig.app.json文件報(bào)錯(cuò)解決辦法,需要的朋友可以參考下

報(bào)錯(cuò)現(xiàn)象:

安裝vite后“main.ts” 和 “tsconfig.app.json” 文件報(bào)錯(cuò)

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import router from './router'

安裝vite后,“main.ts” 文件中這幾行出現(xiàn)了報(bào)錯(cuò),如圖所示:

鼠標(biāo)移動(dòng)到報(bào)錯(cuò)位置,顯示提示:
“Cannot find module ‘vue’. Did you mean to set the ‘moduleResolution’ option to ‘node’, or to add aliases to the ‘paths’ option?ts(2792)”,
如圖所示:

“tsconfig.app.json” 文件也會(huì)報(bào)錯(cuò),如圖:

鼠標(biāo)移動(dòng)到報(bào)錯(cuò)的紅色下劃線(xiàn)位置,出現(xiàn)錯(cuò)誤提示 “JSON schema for the TypeScript compiler’s configuration file
Option ‘–resolveJsonModule’ cannot be specified without ‘node’ module resolution strategy.ts”,如圖:

解決方法

根據(jù)報(bào)錯(cuò)提示:“Cannot find module ‘vue’. Did you mean to set the ‘moduleResolution’ option to ‘node’, or to add aliases to the ‘paths’ option?ts(2792)”,

在 “tsconfig.app.json” 文件 的"compilerOptions" 選項(xiàng)中添加配置- - -“moduleResolution”: “node”,添加后保存文件,“main.ts” 和 “tsconfig.app.json” 文件中的報(bào)錯(cuò)就消失了。

總結(jié) 

到此這篇關(guān)于vue3-vite安裝后main.ts文件和tsconfig.app.json文件報(bào)錯(cuò)解決辦法的文章就介紹到這了,更多相關(guān)vue3-vite安裝后文件報(bào)錯(cuò)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論