eslint --fix 報錯 can't not find modules
當我們使用了從其他地方拿來的程式碼,可能會在我們的 eslint 環境下因為格式的問題,成噸地報錯,這個時候如果用eslint 的 --fix
修復豈不是美滋滋,但當你執行指令碼的時候,卻發現eslint 報錯:
Error: Cannot find module [你的 eslint 規則]
Referenced from: I:\testLanding\.eslintrc.js
這其實是因為你的 eslint 在全域性下也安裝了,而全域性環境下沒有你的 eslint 規則,這個時候,只要在全域性安裝你的 eslint 規則即可。
npm i [你的eslint] 規則 -g
當你美滋滋地再次執行的時候,可能會發現又報錯了,這可能是因為還有別的包沒有安裝,例如 eslint-plugin-react 和 eslint-babel,報錯下說少了什麼,就安裝什麼即可。
這樣,eslint --fix 報錯 can't not find modules 的問題就解決了。
參考文章:
ESLint fails to find plugin in node_modules folder
Local vs. Global installation
相關文章
- Supervisor 解決 can't find command *
- Python報錯:UnicodeDecodeError: 'gbk' codec can't decode byte ...PythonUnicodeError
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- 小程式真機報錯errMsg: “hideLoading:fail:toast can‘t be found“ ?IDEAIAST
- 完美解決stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.ErrorPython
- 記一次 報錯:Android ClassNotFoundException: Didn't find class on pathAndroidException
- 解決eslint報錯EsLint
- Unlucky because now anybody can shoot with their hot fix
- Android開發:Android虛擬機器啟動錯誤Can't find 'Linux version ' string in kernel image fileAndroid虛擬機Linux
- OSError: [E050] Can‘t find model ‘en_core_web_sm‘. It doesn‘t seem to be a shortcut link, a Python pErrorWebPython
- Python3.7使用pip install xxxx報錯:UnicodeDecodeError: 'gbk' codec can't decode bytePythonUnicodeError
- MySQL報錯Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table.MySqlPluginError
- GTID複製報錯處理:Last_Error: Error 'Can't drop database 'test';ASTErrorDatabase
- PIP3安裝報錯nicodeDecodeError: 'ascii' codec can't decode byte 0xc3ErrorASCII
- Mac電腦下使用Socket報錯socket丟擲Can’t assign requested address解決Mac
- VUE—刪除HelloWorld.vue後報錯 `--fix` option報錯的解決Vue
- [LeetCode] 3011. Find if Array Can Be SortedLeetCode
- [mac pip錯誤]Can't connect to HTTPS URL because the SSL module is not availableMacHTTPAI
- 【python爬蟲】用selenium爬時報錯UnicodeEncodeError: ‘gbk‘ codec can‘t encode character ‘\u2022‘Python爬蟲UnicodeError
- Find and Fix the Mismatch Between DBA_SEGMENTS and DBA_EXTENTS ViewsView
- TypeError: can‘t concat str to bytesError
- Can't open file: (errno: 24)
- Opatch - Where Can I Find the Latest Version of Opatch?
- 解決eslint空格報錯等問題EsLint
- mysql 啟動報錯Can't connect to local MySQL server through socket '/data/mysql/mysql/mysql.sock'(111)MySqlServer
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- mongodb find報錯怎麼解決MongoDB
- webstrom配置一鍵修復ESLint的報錯WebEsLint
- Mongoose can't update timestampGo
- 小白:關於處理“can't find '__main__' module in ”這個問題的詳細處理方式!AI
- vue3 報錯解決:找不到模組或其相應的型別宣告。(Vue 3 can not find module)Vue型別
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock錯誤MySqlServer
- VSCode格式化前端程式碼後Eslint報錯VSCode前端EsLint
- mysql遇到Variable can’t be set to the value of ‘NULL’MySqlNull
- MySQL 2003 - Can’t connect to MySQL server on (10060)MySqlServer
- Can't load IA 32-bit .dll on a
- multiprocessing pool AttributeError: Can't get attribute 'func'Error
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer