win系統vscode使用遇到的问题

在使用VSCode进行开发时,遇到了一系列与替换功能和eslint相关的错误。包括文件替换后报错、未识别的yarn命令、eslint包下载失败、启动项目错误、eslint配置不兼容以及各种eslint校验错误等。通过查阅资料和尝试,逐步解决了这些问题,如安装yarn、调整eslint配置、关闭eslint语法检查等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

替换vscode中替换组件遇到的问题
1.替换某个文件后报错

 ERROR  Failed to compile with 1 error

 error  in ./src/components/sbcbiz/JSelectMultiUser.vue

D:\source\ff2022\laoqivue\src\components\sbcbiz\JSelectMultiUser.vue
  19:18  error  The "SDate" component has been registered but not used  vue/no-unused-components

✖ 1 problem (1 error, 0 warnings)

去提到的文件中看

"eslintConfig": {
    "extends": "eslint-config-i-am-meticulous",
    "rules": {
      "no-var": 0,
      "prefer-const": 0
    }
  },

去vscode右下角弹窗提示的包中看,可能时eslint初始化时下载包出了问题
https://blog.youkuaiyun.com/weixin_58487208/article/details/121667121

https://mall.youkuaiyun.com/vip
2.执行

yarn add eslint-plugin-promise eslint-plugin-node eslint-plugin-import eslint-plugin-standard eslint-config-standard -D

时报错

无法识别yarn
https://blog.youkuaiyun.com/nxg0916/article/details/123462258
可能是没有安装yarn
3.安装后执行第一步的下载eslint相关包的命令,报错

error An unexpected error occurred: "ENOENT: no such file or directory, copyfile 'C:\\Users\\ruby\\AppData\\Local\\Yarn\\Cache\\v6\\npm-isarray-2.0.5-integrity\\node_modules\\isarray\\index.js' -> 'D:\\source\\ff2022\\laoqivue\\node_modules\\algoliasearch\\node_modules\\isarray\\index.js'".

按照提示复制对应文件,重新执行命令,这次成功了。
4.启动项目,又报了第一个错误
5.改动一个文件后报错

 ERROR  Failed to compile with 1 errors                                                                                                                               10:17:14

 error  in ./src/components/sbc/JEllipsis.vue

Module build failed (from ./node_modules/vue-loader/lib/index.js):
Error: ENOENT: no such file or directory, open 'D:\source\ff2022\laoqivue\src\components\sbc\JEllipsis.vue'

 @ ./src/components/sbc/index.js 8:0-40 23:31-40
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://10.10.17.97:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js babel-polyfill whatwg-fetch ./src/main.js

6.始终install失败,用yarn install
https://blog.youkuaiyun.com/zhudingfengshen/article/details/121512841
7.eslint配置有问题,更换配置文件
8.报错。

ESLint: Failed to load config "standard" to extend from. Referenced from: D:\source\ff2022\laoqivue\src\.eslintrc.js. Please see the 'ESLint' output channel for details.

缺少东西。安装
https://blog.youkuaiyun.com/weixin_58487208/article/details/121667121链接里有eslint配置的链接

9.安装后报错,eslint-config-standard与eslint版本不兼容

ESLint: src\.eslintrc.js » eslint-config-standard: Environment key "es2021" is unknown . Please see the 'ESLint' output channel for details.

10.自定义.eslintrc.js后报错

ERROR  Failed to compile with 1 errors                                                                                                              11:12:19

 error  in ./src/main.js

Module build failed (from ./node_modules/eslint-loader/index.js):
Error: Failed to load plugin 'js' declared in 'src\.eslintrc.js': Cannot find module 'eslint-plugin-js'
Require stack:
- D:\source\ff2022\laoqivue\__placeholder__.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at Object.resolve (D:\source\ff2022\laoqivue\node_modules\eslint\lib\shared\relative-module-resolver.js:44:50)
    at ConfigArrayFactory._loadPlugin (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\config-array-factory.js:959:39)
    at D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\config-array-factory.js:848:33
    at Array.reduce (<anonymous>)
    at ConfigArrayFactory._loadPlugins (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\config-array-factory.js:844:22)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\config-array-factory.js:667:32)       
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\config-array-factory.js:596:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\config-array-factory.js:340:25)
    at ConfigArrayFactory.loadInDirectory (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\config-array-factory.js:433:16)
    at CascadingConfigArrayFactory._loadConfigInAncestors (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:328:46)
    at CascadingConfigArrayFactory.getConfigArrayForFile (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:272:18)
    at CLIEngine.isPathIgnored (D:\source\ff2022\laoqivue\node_modules\eslint\lib\cli-engine\cli-engine.js:951:18)

 @ multi (webpack)-dev-server/client?http://10.10.17.97:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js babel-polyfill whatwg-fetch ./src/main.js     

11.注册了组件而没有使用

error  The "Ellipsis" component has been registered but not used  vue/no-unused-components

更改规则
https://blog.51cto.com/u_12564104/2894119

https://blog.youkuaiyun.com/weixin_44863521/article/details/112002804
12.报错

 warning  in ./src/views/system/DataLogList.vue

Module Error (from ./node_modules/eslint-loader/index.js):

D:\source\ff2022\laoqivue\src\views\system\DataLogList.vue
  53:52  error  'record' is defined but never used  vue/no-unused-vars

✖ 1 problem (1 error, 0 warnings)


 @ ./src/views sync ^\.\/.*$
 @ ./src/utils/routerUtil.js
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://10.10.17.97:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js babel-polyfill whatwg-fetch ./src/main.js     

又是eslint校验错误
https://blog.youkuaiyun.com/weixin_37580383/article/details/108354368
13. v-for使用报错
14. https://blog.youkuaiyun.com/weixin_41996632/article/details/89338501
改了之后依然报错,关闭eslint语法检查
vue.config.js的module.exports中添加lintOnSave : false
13.
at-rule or selector expected css报错

at-rule or selector expected css

https://blog.youkuaiyun.com/chunmeizhang_88/article/details/102470573

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值