私有NPM注册表-@latest不在npm注册表中

时间:2020-09-24 08:30:27

标签: npm couchdb npm-registry

我已经按照this page中的说明设法建立了一个私有npm注册表。与注册表交互时,我使用npm scope

npm config set @example:registry http://admin:password@localhost:5984/registry/_design/app/_rewrite

我创建一个名为test的文件夹,并在其中放置一个文本文档,然后导航到该文件夹​​并运行

npm init --scope=@example

我不更改任何默认值,并且创建了package.json文件。由于该软件包是作用域内的,所以我可以将其发布到我的注册表中

npm publish

我可以看到它以@ example / test的形式出现在CouchDB中。我在运行时还可以在注册表中查看有关软件包的详细信息

npm view @example/test

这包括以下几行

dist-tags:
latest: 1.0.0

当我创建另一个文件夹并尝试安装时

npm install @example/test

我得到以下内容

npm ERR! code E404
npm ERR! 404 Object Not Found - GET http://admin:password@localhost:5984/registry/_design/app/@example/test/-/@example/test-1.0.0.tgz
npm ERR! 404
npm ERR! 404  '@example/test@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.

值得一提的是,当我导航到注册表时,在CouchDB gui中-> @ example / test并选择“查看附件”,我可以看到一个@ example / test-1.0.0.tgz文件

0 个答案:

没有答案