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
相關文章
- MongoDB報錯:"assertion" : "can't map file memory"MongoDB
- Supervisor 解決 can't find command *
- 解決can't find -lGL的問題
- cordova 解決can’t not find moudle " plugman platform ios"PlatformiOS
- Mysql報錯Fatal error:Can't open and lock privilege tablesMySqlError
- MySQL 建立外來鍵報錯Can't write; duplicate key in tableMySql
- MySQL 5.5 原始碼安裝報錯"[ERROR] Can't start server"MySql原始碼ErrorServer
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- Can't use function return value in write context 使用empty遇到報錯FunctionContext
- Can't find keyplane that supports type 4 for keyboard iPhone PortraitTiPhoneAI
- 解決eslint報錯EsLint
- mysql匯入報錯Variable 'sql_notes' can't be set to the value of 'NULL'MySqlNull
- RMAN的"rman: can't open target"錯誤
- Unlucky because now anybody can shoot with their hot fix
- 記一次 報錯:Android ClassNotFoundException: Didn't find class on pathAndroidException
- python報錯問題解決:'ascii' codec can't encode characterPythonASCII
- CentOS 6.5安裝perl模組報錯'Can't locate ExtUtils/Manifest.pm'CentOS
- 解決Error (1133): Can’t find any matching row in the user tableError
- "Error: Can't find libjava.so" 9.2.0.4 on RH 4.0 x86-64ErrorJava
- 完美解決stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.ErrorPython
- GTID複製報錯處理:Last_Error: Error 'Can't drop database 'test';ASTErrorDatabase
- MySQL報錯Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table.MySqlPluginError
- Python報錯:UnicodeDecodeError: 'gbk' codec can't decode byte ...PythonUnicodeError
- pip install 報錯UnicodeDecodeError: 'ascii' codec can't decode byteUnicodeErrorASCII
- 32bit Pl/SQL developer 報can not find oci.dllSQLDeveloper
- 【Shell】fix 1032報錯資訊的指令碼指令碼
- VUE—刪除HelloWorld.vue後報錯 `--fix` option報錯的解決Vue
- MySQL 5.5 關閉資料庫報錯"Can't connect to local MySQL server through socket"MySql資料庫Server
- 小程式真機報錯errMsg: “hideLoading:fail:toast can‘t be found“ ?IDEAIAST
- OSError: [E050] Can‘t find model ‘en_core_web_sm‘. It doesn‘t seem to be a shortcut link, a Python pErrorWebPython
- Can't find the 'libpq-fe.h header when trying to install pg gemHeader
- java.util.MissingResourceException: Can't find resource for bundle oracle.sysman.db.rsc.LoginResourcJavaExceptionOracle
- 啟動infobright的時候遇見Can't find file: './mysql/host.frm'MySql
- 辛星淺析ruby下的mkmf.rb can't find header files for ruby atHeader
- can't assign requested address 錯誤解決
- rman: can't open target
- Dubbo廣播模式下報錯:Can't assign requested address解決辦法模式
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer