這個問題在這里已經有了答案: 嘗試使用 create-react-app 安裝 ESLint 8.4.4 時找不到 404 2 個答案 3天前關閉。
我已經使用命令 npm install -g @angular/cli 安裝了 angular-cli。當我嘗試運行命令 ng new 并創建一個新專案時,出現錯誤:
? Installing packages (npm)...npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types/eslint/-/eslint-8.4.4.tgz - Not found
npm ERR! 404
npm ERR! 404 '@types/eslint@https://registry.npmjs.org/@types/eslint/-/eslint-8.4.4.tgz' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
這個錯誤應該如何解決?
uj5u.com熱心網友回復:
在嘗試安裝 React 或任何其他依賴于 eslint 的框架時,也會發生在其他人身上。
創建反應應用程式中止 - 未找到 ESLINT
這是 Eslint github 的鏈接:https ://github.com/DefinitelyTyped/DefinitelyTyped/issues/61032
現在的解決方法是運行ng new app --skip-install,然后添加"@types/eslint": "8.4.3"到您的 package.json 并執行npm install。
uj5u.com熱心網友回復:
我使用舊版本的腳本解決了這個問題:
npx create-react-app --scripts-version 4.0.3 app-name
uj5u.com熱心網友回復:
包含到 package.json
"resolutions": {
"@types/eslint": "8.4.3"
}
uj5u.com熱心網友回復:
嘗試使用版本 8.4.3 臨時在本地安裝依賴項。它對我有用??
npm i -D @types/[email protected]
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/498287.html
