小编MLI*_*CTM的帖子

React 依赖树中的冲突

运行 React 应用程序时,我在控制台中收到此错误 - 从 2021 年 5 月左右的 M91 开始,SharedArrayBuffer 将需要跨域隔离。有关更多信息,请参阅https://developer.chrome.com/blog/enabling-shared-array-buffer/细节。

根据 StackOverflow 的建议,我尝试更新 React 版本。我的版本是 16,后来切换到了 17。但是现在依赖树中存在冲突。当我尝试 npm install 时,出现以下错误:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@">=16.8.0" from @emotion/react@11.1.5
npm ERR!   node_modules/@emotion/react
npm ERR!     @emotion/react@"^11.1.1" from react-select@4.3.0
npm ERR!     node_modules/react-select
npm ERR!       react-select@"^4.2.1" from the root project
npm ERR!   17 more …
Run Code Online (Sandbox Code Playgroud)

node.js npm reactjs package.json npm-install

5
推荐指数
1
解决办法
6099
查看次数

标签 统计

node.js ×1

npm ×1

npm-install ×1

package.json ×1

reactjs ×1