npm错误!在安装styled-components时无法读取null的属性(读取’edgesOut’)。

huangapple go评论64阅读模式
英文:

npm ERR! Cannot read properties of null (reading 'edgesOut') when npm i styled-components

问题

C:\Users\user\Desktop\react_sce\test1> npm i styled-components
>npm ERR! 无法读取 null 的属性 (读取 'edgesOut')
npm ERR! 可以在此运行的完整日志文件位于: C:\Users\user\AppData\Local\npm-cache_logs\2023-05-10T09_34_26_806Z-debug-0.log

英文:
C:\Users\user\Desktop\react_sce\test1> npm i styled-components  

>npm ERR! Cannot read properties of null (reading 'edgesOut')
npm ERR! A complete log of this run can be found in: C:\Users\user\AppData\Local\npm-cache_logs\2023-05-10T09_34_26_806Z-debug-0.log

答案1

得分: 24

To Fix this, use specifically 5.3.10 version of styled-components

For projects using JS/JSX (JavaScript)

npm install styled-components@5.3.10

For projects using TS/TSX (TypeScript)

npm install styled-components@5.3.10 @types/styled-components

英文:

To Fix this, use specifically 5.3.10 version of styled-components

For projects using JS/JSX (JavaScript)

npm install styled-components@5.3.10

For projects using TS/TSX (TypeScript)

npm install styled-components@5.3.10 @types/styled-components

答案2

得分: 0

For this error use:
npm install --save-dev babel-plugin-styled-components

英文:

For this error use:

npm install --save-dev babel-plugin-styled-components

答案3

得分: 0

需要安装最新的 styled-components 版本 5。

使用 npm <br>
npm install styled-components@5

使用 yarn <br>
yarn add styled-components@5

英文:

You need to install the latest styled-components version 5.

with npm <br>
npm install styled-components@5

with yarn <br>
yarn add styled-components@5

huangapple
  • 本文由 发表于 2023年5月10日 17:45:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76216979.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定