大家好,今天我遇到了一个问题,当我使用react安装laravel ui并传递到npm install步骤时发生了错误,所以下面你会发现错误
npm ERR! A complete log of this run can be found in: npm ERR! C:UsersE495AppDataLocalnpm-cache_logs2023-01-16T08_08_36_872Z-debug-0.log PS C:UsersE495Desktoplaravel-simple-crud> npm install npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: vite@4.0.4 npm ERR! node_modules/vite npm ERR! dev vite@"^4.0.4" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-react@2.2.0 npm ERR! node_modules/@vitejs/plugin-react npm ERR! dev @vitejs/plugin-react@"^2.2.0" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See C:UsersE495AppDataLocalnpm-cacheeresolve-report.txt for a full report.
因此,在错误上方和下方,您将找到我的 package.json
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"@popperjs/core": "^2.11.6",
"@tailwindcss/forms": "^0.5.2",
"@vitejs/plugin-react": "^2.2.0",
"alpinejs": "^3.4.2",
"autoprefixer": "^10.4.2",
"axios": "^1.1.2",
"bootstrap": "^5.2.3",
"laravel-vite-plugin": "^0.7.2",
"lodash": "^4.17.19",
"postcss": "^8.4.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.56.1",
"tailwindcss": "^3.1.0",
"vite": "^4.0.4"
}
}
我尝试读取错误并将vite版本更改为4.0.4但没有任何结果
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号