当前位置: 首页 > news >正文

git commit提交报错

git commit -m '名字’时报一下错误:

[FAILED] npm run lint-staged:js [FAILED]
[FAILED] npm run lint-staged:js [FAILED]
[SUCCESS] Running tasks for staged files..npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Program Files\nodejs\node_cache\_cacache\tmp\6e53bf01
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\6e53bf01'
npm ERR!   errno: -4048,
npm ERR!   syscall: 'open',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache\\tmp\\6e53bf01'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.npm ERR! Log files were not written due to an error writing to the directory: C:\Program Files\nodejs\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

错误引起:

git提交时的检测代码规范机制

解决方案:

搜的方法是说:

  1. 检查lint-staged配置:在项目的package.json文件中,找到lint-staged字段
  2. 清除缓存: npm cache claen
  3. 我用的是以下方法,用来跳过检测机制,输入一下命令:
git commit --no-verify -m '提交名'
  1. 找到根目录.eslintignore文件,将src放入其中,git提交时跳过src目录中的检测机制
node_modules
dist
node_modules/*
src

注意:

使用–no-verify命令时,git将会忽略任何预定义的提交钩子脚本,包括lint-staged脚本,但是绕过提交是有风险的,使用前要自行检查提交的代码。

http://www.lryc.cn/news/229360.html

相关文章:

  • OpenSIPS自定义统计项目
  • python数据结构与算法-02_数组和列表
  • 计算机网络基础知识-网络协议
  • 【Vue3】scoped 和样式穿透
  • Python 邮件发送(163为例)
  • BlendTree动画混合算法详解
  • 2013年01月16日 Go生态洞察:并发不是并行
  • CRM销售管理软件哪个好,该如何选择?(一)
  • Django路由层解析
  • 高教社杯数模竞赛特辑论文篇-2023年A题:定日镜场的输出功率优化(附获奖论文及MATLAB代码实现)(中)
  • libusb获取Windows设备实例路径DevicePath
  • File Upload
  • Qt数据库之QTabelModel
  • 计算机视觉(CV)技术的优势和挑战
  • 面试官:【后端一次性返回10万条数据怎么处理/后端发送大数据量的数据如何处理】
  • 深入理解强化学习——多臂赌博机:梯度赌博机算法的数学证明
  • StackExchange.Redis 高并发下timeout超时问题如何解决?
  • JAVA基础7:数组
  • Riskified: 2023年电商政策滥用问题恶化,正严重挑战商家盈利底线
  • 【论文阅读】多模态NeRF:Cross-Spectral Neural Radiance Fields
  • Huggingface
  • 【深度学习】pytorch——常用工具模块
  • 【Android】统一系统动画
  • 京东数据运营与分析:如何全面获取电商销售数据?
  • du_命令可以像find_命令那样列出最大的文件吗
  • asp.net blazor集成TinyMCE.Blazor
  • CSS注入的四种实现方式
  • 突然消失的桌面文件如何恢复?详细教程让你轻松解决问题!
  • Springboot+Dubbo+Nacos 集成 Sentinel(入门)
  • ARPG----C++学习记录05 Section10 武器类,IK重定向,装备和捡起武器,动画蓝图