如何使用github源代码在NPM中发布模块

how to publish a module in NPM with github source

本文关键字:布模块 模块 github 何使用 源代码 NPM      更新时间:2023-09-26

我希望我的存储库可以这样安装:

$ npm install git://github.com/ariellyrycs/testpublishnpm

我所做的是:

  • 安装npm和nodejs

  • 添加我的信息

    npm set init.author.name "name" npm set init.author.email "email" npm set init.author.url "url"

    • npm init。以便创建package.json
  • 在npm官方页面注册。

    • npm adduser并插入我的信息

    • git commitpush到我的新存储库

    • npm publish .

然后我出现了错误:

npm ERR! publish Failed PUT 403
npm ERR! Linux 3.13.0-34-generic
npm ERR! argv "node" "/usr/local/bin/npm" "publish" "."
npm ERR! node v0.11.14-pre
npm ERR! npm  v2.1.2
npm ERR! code E403

npm上已经有一个名为ariel的模块,因此npm基本上是在告诉您不能发布,因为您在npm上没有该模块的发布权限。

您可以尝试为模块选择其他名称。