我在 Vue 项目中使用 TypeScript。
但是当我尝试导入 vue 文件时,由于出现“找不到模块...”错误,我无法获取 .vue 文件。
奇怪的是,intellisense 仅显示 .vue 文件正上方的目录。
我的根目录中还有 vue-shim.d.ts 文件。
eslint --ext \".js,.ts,.vue\" --ignore-path .gitignore .使用 运行脚本时npm run lint,出现以下错误。
/(somethingSomething...)/Test.vue
0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: components/Test.vue.
The extension for the file (.vue) is non-standard. You should add "parserOptions.extraFileExtensions" to your config
Run Code Online (Sandbox Code Playgroud)
我正在使用vue-eslint-parser和eslint-plugin-vue作为 devDependency。并.eslintrc.js包含
...
extends: [
...
'plugin:vue/recommended',
"eslint:recommended"
],
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
project: './tsconfig.eslint.json'
},
plugins: [
'html',
'vue',
'jest'
],
...
Run Code Online (Sandbox Code Playgroud)
如手册中所述。并且tsconfig.eslint.json …
每当我尝试运行npm install或npm update在我的 nuxt.js(vue.js) 项目中时,都会出现以下错误。
npm ERR! code 1
npm ERR! path /Users/kyeolhan/ForWork/BackOffceFront/node_modules/deasync
npm ERR! command failed
npm ERR! command sh -c node ./build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.14.2 | darwin | arm64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp …Run Code Online (Sandbox Code Playgroud)