0


Cannot find module lint-staged 解决办法

使用git lint-stag后,再commit时报错

Cannot find module lint-staged
internal/modules/cjs/loader.js:818throw err;^Error: Cannot find module 'C:\Users\yunlu\Desktop\yuntuan\yuntuanwebsite\node_modules\lint-staged\index.js'
    at Function.Module._resolveFilename(internal/modules/cjs/loader.js:815:15)
    at Function.Module._load(internal/modules/cjs/loader.js:667:27)
    at Function.executeUserEntryPoint [as runMain](internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47{code:'MODULE_NOT_FOUND',requireStack:[]}
husky - pre-commit hook exited with code 1(error)

重新npm install和npm install lint-stag都不生效,最后把

node_modules删掉

,再重新

npm install

就好用啦!

PSC:\Users\yunlu\Desktop\xxx> npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
> [email protected] prepare
> husky install

husky - Git hooks installed

added 427 packages, removed 42 packages, and changed 290 packages in 2m
PSC:xxx> git commit -m "fix: 更改ws 服务端接口"> [email protected] lint
> eslint src --fix --ext .ts,.tsx,.vue,.js,.jsx

> [email protected] lint-staged
> lint-staged

Stashing changes...[started]
Stashing changes...[skipped]
→ No partially staged files found...
Running linters...[started]
Running tasks for src/**/*.{js,jsx,vue,ts,tsx}[started]
eslint --ext .js,.jsx,.vue,.ts,.tsx src --fix [started]
eslint --ext .js,.jsx,.vue,.ts,.tsx src --fix [completed]
eslint --fix --max-warnings 0[started]
eslint --fix --max-warnings 0[completed]
prettier --write [started]
prettier --write [completed]
git add [started]
git add [completed]
Running tasks for src/**/*.{js,jsx,vue,ts,tsx}[completed]
Running linters...[completed][dev db5742da5] fix: 更改ws 服务端接口
 1 file changed,24insertions(+),26deletions(-)PSC:\Users\yunlu\Desktop\xxx> git pull
remote: Enumerating objects:5, done.remote: Counting objects:100%(5/5), done.remote: Compressing objects:100%(5/5), done.remote: Total 5(delta 0), reused 0(delta 0), pack-reused 0
Unpacking objects:100%(5/5),3.09 KiB |4.00 KiB/s, done.
From http://192.168.xx.xxx:xxxx/xxx/yuntuanwebsite
   9cfe3c929..002f1a494  dev                   -> origin/dev
   002f1a494..4839e541b  feature_login_xxx -> origin/feature_login_xxx
Merge made by the 'ort' strategy.README.md                                          |9+-
 src/components/Navigations/Navigation/index.scss   |1-.../Navigations/PersonalCenter/index.jsx           |8--
 src/components/Navigations/index.jsx               |12+-
 src/components/RightPopup/index.jsx                |132+++++++++++++--------
 src/components/RightPopup/index.scss               |3-
 src/components/x6_reademe.md                       |1-
 src/config/index.js                                |20+---
 src/index.css                                      |19+--9 files changed,90insertions(+),115deletions(-)
标签: javascript vue.js git

本文转载自: https://blog.csdn.net/weixin_38318244/article/details/127878719
版权归原作者 仙女爱吃鱼 所有, 如有侵权,请联系我们删除。

“Cannot find module lint-staged 解决办法”的评论:

还没有评论