我已经更改了我的节点版本,并且如果我尝试安装另一个软件包或只是尝试运行npm install. 这是错误消息:
npm 错误!代码 EOVERRIDE
npm 错误!覆盖react-error-overlay@^6.0.9与直接依赖项冲突
npm 错误!此运行的完整日志可以在以下位置找到:
npm 错误!C:\Users\admin\AppData\Local\npm-cache_logs\2022-12-08T16_39_09_063Z-debug-0.log`
我的package.json文件如下:
{
"name": "kamamini",
"version": "0.1.0",
"author": "Moctar Yonli",
"private": true,
"dependencies": {
"@ckeditor/ckeditor5-build-classic": "^28.0.0",
"@ckeditor/ckeditor5-build-decoupled-document": "^28.0.0",
"@ckeditor/ckeditor5-react": "^3.0.2",
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@firebase/auth-interop-types": "^0.1.5",
"@glidejs/glide": "^3.5.2",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"@metismenu/react": "0.0.2",
"@mui/icons-material": "^5.0.5",
"@mui/material": "^5.0.6",
"@mui/styles": "^5.0.2",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.7.1",
"axios": "^0.24.0",
"bootstrap": "^5.1.3",
"dotenv": "^10.0.0",
"firebase": "^8.4.1",
"formik": "^2.2.9",
"framer-motion": "^4.1.17",
"gh-pages": "^3.2.3",
"history": "^5.0.1",
"moment": "^2.29.4",
"node-sass": …Run Code Online (Sandbox Code Playgroud) 我陷入了这样的境地:要么有 22 个漏洞,要么有 47 个漏洞。我可以运行npm audit fix,但总是建议我运行--force交换机才能实际执行升级。从那里我可以升级并获得 22 个漏洞,然后我再次执行--force并获得 47 个漏洞,这个循环永远持续下去。最好的解决办法是什么,让包裹保持原样?
我的包.json
"dependencies": {
"animate.css": "^4.1.1",
"axios": "^0.21.1",
"bootstrap": "^4.5.3",
"http-proxy-middleware": "^0.19.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-ga": "^3.3.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^1.1.5",
"universal-cookie": "^4.0.4",
"web-vitals": "^0.2.4"
},
Run Code Online (Sandbox Code Playgroud)
当我npm --audit fix在一种情况下尝试时:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest@0.21.3
npm ERR! node_modules/type-fest
npm ERR! type-fest@"^0.21.3" from ansi-escapes@4.3.2
npm ERR! node_modules/ansi-escapes
npm ERR! ansi-escapes@"^4.2.1" …Run Code Online (Sandbox Code Playgroud) 每次我用创建一个反应应用程序时npx create-react-app <AppName>,我都会得到:
96 vulnerabilities found - Packages audited: 1682
Severity: 65 Moderate | 30 High | 1 Critical
Node Version: v14.18.1
Npm: 7.20.5
React: ^17.0.2
Run Code Online (Sandbox Code Playgroud)
当我使用npm audit fixOR时npm audit fix --force,结果如下:
68 vulnerabilities (21 moderate, 45 high, 2 critical)
47 vulnerabilities (12 low, 18 moderate, 15 high, 2 critical)
58 vulnerabilities (16 moderate, 40 high, 2 critical)
48 vulnerabilities (12 low, 18 moderate, 16 high, 2 critical)
58 vulnerabilities (16 moderate, 40 high, …Run Code Online (Sandbox Code Playgroud) 最新版本create-react-app是4.0.3,但当我运行时npx create-react-app my-app它使用版本 1.5.2 并且也不使用模板运行。我没有任何全局安装,并尝试使用 卸载它npm uninstall -g create-react-app。
我的npm版本是7.21.1,node版本是16.9.1
我怎样才能让它发挥作用?请帮忙。
编辑:创建应用程序时有 58 个漏洞,这出现在最后 -
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.
Run Code Online (Sandbox Code Playgroud)
该文件夹也没有src文件夹,只有node_modules文件夹和package.json文件。
跑步时npm audit fix …
npm ×4
reactjs ×4
node.js ×3
dependencies ×1
javascript ×1
npm-audit ×1
npx ×1
package.json ×1
webpack ×1