首页 > 解决方案 > 发布新的 NPM 包时未找到 E404

问题描述

我正在尝试发布一个名为 nibble-qmk-hid 的新 npm 包。我已经通过npm init. 我已经通过 登录到 npm npm login,然后当我尝试通过 发布包时npm publish --access public,我收到以下错误:

npm ERR! code E404
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/nibble-qmk-hid
npm ERR! 404
npm ERR! 404  'nibble-qmk-hid@1.0.0' 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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Alex\AppData\Roaming\npm-cache\_logs\2020-08-23T17_47_29_933Z-debug.log

我也尝试将 npm 更新到最新版本。

标签: node.jsnpmnode-modules

解决方案


一次合理的解释可能是您需要拥有一个 npm 帐户并登录。在发布之前尝试此操作:

npm login

做不到这一点,试试文档


推荐阅读