未找到此依赖项 - TypeScript、Vue [英] This dependency was not found - TypeScript, Vue
本文介绍了未找到此依赖项 - TypeScript、Vue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 TS 和 Vue 的新手.
I am new to TS and Vue.
尝试执行 vue-cli-service serve 时出现以下错误:
Getting following error when trying to do vue-cli-service serve:
This dependency was not found:
* @store in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/ts-loader??ref--12-1!./node_modules/vue-loader/lib??vue-loader-opt
ions!./src/components/HelloWorld.vue?vue&type=script&lang=ts&
To install it, you can run: npm install --save @store
在 ./src/components/HelloWorld.vue 中:
And in ./src/components/HelloWorld.vue :
import { RootState, storeBuilder, CustomerStore } from '@store';
在 tsconfig.json 中:
And in tsconfig.json :
"baseUrl": "./src",
"paths": {
"@/*": ["src/*"],
"store": ["./store/index.ts"],
但是,当我将导入更改为以下时,错误就会消失.
However when I change import to following then the error goes away.
import { RootState, storeBuilder, CustomerStore } from './../store';
我需要任何额外的配置或包吗?我的堆栈:
Do I need any extra config or package? My stack:
- vue 3.0.1
- tsc 3.0.3
推荐答案
'@store';
应该
'@/store';
这篇关于未找到此依赖项 - TypeScript、Vue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文