Require statement not part of import statement.(@typescript-eslint/no-var-requires)

目录

一、出现Require statement not part of import statement.(@typescript-eslint/no-var-requires)

二、error An unexpected error occurred: "https://github.com/eligrey/FileSaver.js.git/info/refs?service=git-upload-pack: connect ETIMEDOUT 20.205.243.166:443

三、Vue3 忽略 ts (TypeScript)的无故报错

四、Recommendation: math.div(1, 5) More info and automated migrator: https://sass-lang.com/d/slash-div

五、表单初始化数据提示 Property "xxx" was accessed during render but is not defined on instance. 

六、遍历提示错误 'v-model' directives cannot update the iteration variable itself

七、 npm报错:npm ERR! cb.apply is not a function

八、cnpm:无法加载文件,因此在此系统上禁止运行脚本。对注册表项的访问被拒绝。要更改默认作用域的执行策略,请使用“以管理员身份运行”选项启动window powershell。要更改当前用户的执行策略 

九、asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).打包文件体积过大 


一、出现Require statement not part of import statement.(@typescript-eslint/no-var-requires)

1、原因

当在项目中使用了vue、typescript、eslint 后,在vue.config.js 文件中:

const path = require('path')

会提示报错:

Require statement not part of import statement.(@typescript-eslint/no-var-requires)

require部分没有通过import引入,且是@typescript-eslint/no-var-requires检查规则造成。 

2、解决办法:

.eslintrc.js文件中的 rules 属性新增以下内容:

  rules: {
    '@typescript-eslint/no-var-requires': 0
  }

二、error An unexpected error occurred: "https://github.com/eligrey/FileSaver.js.git/info/refs?service=git-upload-pack: connect ETIMEDOUT 20.205.243.166:443

解决办法:

error An unexpected error occurred: “https://github.com/eligrey/FileSaver.js.git/info/refs?service=g_小草莓蹦蹦跳的博客-CSDN博客

 

三、Vue3 忽略 ts (TypeScript)的无故报错

解决办法:

 Vue3 忽略 ts (TypeScript)的无故报错_忽略ts报错_小草莓蹦蹦跳的博客-CSDN博客

 

四、Recommendation: math.div(1, 5) More info and automated migrator: https://sass-lang.com/d/slash-div

解决方法:

将 "sass": "^1.26.5",    替换为  "sass": "~1.26.5",

 

五、表单初始化数据提示 Property "xxx" was accessed during render but is not defined on instance. 

解决办法:

Vue3 实际项目踩坑+总结【汇总篇】_小草莓蹦蹦跳的博客-CSDN博客

六、遍历提示错误 'v-model' directives cannot update the iteration variable itself

解决办法:

Vue3 实际项目踩坑+总结【汇总篇】_小草莓蹦蹦跳的博客-CSDN博客 

七、 npm报错:npm ERR! cb.apply is not a function

npm报错:npm ERR! cb.apply is not a function_小草莓蹦蹦跳的博客-CSDN博客 

八、cnpm:无法加载文件,因此在此系统上禁止运行脚本。对注册表项的访问被拒绝。要更改默认作用域的执行策略,请使用“以管理员身份运行”选项启动window powershell。要更改当前用户的执行策略 

cnpm:无法加载文件,因此在此系统上禁止运行脚本。对注册表项的访问被拒绝。要更改默认作用域的执行策略,请使用“以管理员身份运行”选项启动window powershell。要更改当前用户的执行策略_小草莓蹦蹦跳的博客-CSDN博客

九、asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).打包文件体积过大 

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).打包文件体积过大_小草莓蹦蹦跳的博客-CSDN博客 

 

  • 13
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值