我正在使用 React,使用 windows 10,NPM - 2.15.12,Node v6.11.3。在尝试使用 Create-React-App 安装依赖项时 - 我收到以下错误:
C:\xampp\htdocs\react-new-repo>npm i
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\roy\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! node v6.11.3
npm ERR! npm v2.15.12
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react@^16.0.0
npm ERR! peerinvalid Peer [email protected] wants react@^15
npm ERR! peerinvalid Peer [email protected] wants react@^15.4.2
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\react-new-repo\npm-debug.log
看来您不能在您的项目中使用 react v16,因为它具有需要 v15 的依赖项。
您可以指定 v15 以在您的package.json
ie 中做出反应
"dependencies": {
"react": "15.6.2"
...
或者您可以尝试将依赖项(即react-router-dom
和react-intl-tel-input
)升级到适用于 react v16 的版本
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句