3

我正在尝试在我的应用程序中使用以下 bit.dev 社区可重用组件(semantic-ui-react table),我正在尝试的链接如下:

https://bit.dev/semantic-org/semantic-ui-react/table?example=5c920bc8c634f0001a931879

我们可以在应用程序中使用相同的使用npm i @bit/semantic-org.semantic-ui-react.table

但是每当我这样做时,都会出现以下错误(注意:对于其他 @bit 模块,我们也会遇到同样的问题):

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@bit%2fsemantic-org.semantic-ui-react.table - Not found
npm ERR! 404 
npm ERR! 404  '@bit/semantic-org.semantic-ui-react.table@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
4

2 回答 2

2

我认为您收到此错误是因为您尚未配置@bit为注册表。 https://docs.bit.dev/docs/installing-components.html

于 2020-01-29T11:31:30.537 回答
0

从我的私人收藏中提取组件时,我也面临同样的问题。在官方YouTube视频注册表配置步骤中缺少。

要使用 npm 或 yarn 安装组件,我们首先需要将 @bit 配置为作用域注册表。Bit 默认情况下会作为 bit 登录过程的一部分执行此操作。

要手动配置注册表,请使用 npm config 命令。(用于拉取公共组件)

npm config set @bit:registry https://node.bit.dev

要安装私有组件,请使用 npm login。使用您的 Bit 凭据登录。

npm login --registry=https://node.bit.dev --scope=@bit

(这将提示用户通过 CLI 登录。)

于 2020-12-15T07:58:06.417 回答