簡體   English   中英

Eslint緩存是否在分支之間持久存在?

[英]Eslint cache persisting across branches?

它可能不是eslint緩存。

我正在一個使用自定義eslint插件的項目中工作,該插件在本地package.json中引用(未在npm上發布)。

"special-eslint-plugin": "file:special-eslint-plugin-directory"

但是后來我切換到了沒有此軟件包的較舊分支。 它未安裝在node_modules中,也不在package.json中,也未收縮包裝,它不是本地目錄。 當我運行“ npm run lint”(運行grunt lint)時,我得到以下終端輸出:

10:31 AM app 🦄 $ npm run lint
npm info it worked if it ends with ok
npm info using npm@5.5.1
npm info using node@v8.9.2
npm info lifecycle phApp@1.77.0~prelint: phApp@1.77.0
npm info lifecycle phApp@1.77.0~lint: phApp@1.77.0

> phApp@1.77.0 lint /Users/****/Desktop/app/app/
> grunt lint

Running "lint" task

Running "eslint:target" (eslint) task
Warning: Failed to load plugin special-eslint-plugin: Cannot find module 'special-eslint-plugin' Use --force to continue.

Aborted due to warnings.


Execution Time (2018-10-09 10:31:52 UTC-7)
/ ... /

npm info lifecycle phApp@1.77.0~lint: Failed to exec lint script
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! phApp@1.77.0 lint: `grunt lint`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the phApp@1.77.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/***/.npm/_logs/2018-10-09T17_31_53_336Z-debug.log

因此,我認為eslint緩存會在各個分支之間持續存在,並且認為它需要該軟件包。

我嘗試過但不限於的事情:

git clean -xfd && npm cache clear --force && nvm use && npm install
  • 重新安裝節點和npm
  • 重新安裝nvm
  • 刪除我所有的全局軟件包
  • 禁用我所有的編輯器包(IDE中有linters)
  • 刪除本地分支
  • 重新啟動電腦

我在用:

  • 咕嚕
  • 咕嚕,eslint
  • “節點”:“ 8.9.2”
  • “ npm”:“ 5.5.1”
  • 虛擬機0.30.2

有一個運行lint的git鈎子,因此它阻止我在此分支上完成工作

最有趣的部分是,在我的同事計算機上切換到我所在的分支並運行上面的git clean命令后,這沒有發生。 因此,這與我的計算機而不是分支有關。

謝謝

原來我的桌面上藏着一個.eslintrc文件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM