src/permission.ts:5:23 - error TS7016: Could not find a declaration file for module 'nprogress'. 'V:/Web/Github_commit/GuiGuZhenXuan/cundang/Vue_project_SelectionPlatform/vue3_admin_template/project/node_modules/.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/nprogress` if it exists or add a new declaration (.d.ts) file containing `declare module 'nprogress';`
5 import nprogress from 'nprogress'
解决方法:
第一步,跟着提示信息 npm i --save-dev @types/nprogress
第二步,借鉴这篇博客《TSC 编译出现》
在tsconfig.json文件中添加 "allowSyntheticDefaultImports": true
{
“compilerOptions”: {
// …
“allowSyntheticDefaultImports”: true
},
}
···