【问题标题】:Unable to publish npm package from Github?无法从 Github 发布 npm 包?
【发布时间】:2021-01-01 16:37:04
【问题描述】:

我已经使用这个命令发布了react-push-notify

   npm login
   npm publish

但是,当我想通过 Github(私有存储库)再次发布时,请按照以下步骤操作:

  1. publishPackage添加到我的package.json

        "publishConfig": { "registry": "https://npm.pkg.github.com/" }
    
  2. 验证

        npm login --registry=https://npm.pkg.github.com/
    
  3. 发布

       npm publish
    

它调用了这个错误:

npm ERR! code E404
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/react-push-notify
npm ERR! 404
npm ERR! 404  'react-push-notify@0.2.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 上的第一个包,我很困惑发布到 npm 和从 Github 发布到 npm 有什么区别?

【问题讨论】:

    标签: npm npm-publish npm-package


    【解决方案1】:

    登录和注销

    npm login --scope=@[Organization name] --registry=https://npm.pkg.github.com
    npm logout --scope=@My-Organization --registry=https://npm.pkg.github.com
    

    发布

    npm publish
    

    【讨论】:

      猜你喜欢
      • 2022-10-21
      • 1970-01-01
      • 2021-12-24
      • 2021-11-02
      • 2018-09-25
      • 2019-10-29
      • 1970-01-01
      • 2018-11-25
      • 2021-06-27
      相关资源
      最近更新 更多