我们有一个名为“@myorganization/ called”的共享包,应用程序和Google云功能都使用它。
Google函数要求将包发布到回购程序以使用它,因为我们不发布编译过的代码,这些代码可以包含本地包,但直接包含原始的TypeScript。
我找到了服务器式教程,但不适合组合私有包和组织的用例。
我光盘到包/公共目录。
我在我的packages.json中添加了以下几行:
"publishConfig": { "registry": "https://npm.pkg.github.com/" },
"repository": {
"url": "git@github.myorganization/common.git"
},我在GitHub上创建了一个带有完全回购、包和组织权限的个人令牌。
然后我登录到我的组织:
npm login --registry=https://npm.pkg.github.com --scope=@myorganization然后我撞到:
npm publish我得到以下错误:
npm ERR! code EPRIVATE
npm ERR! This package has been marked as private
npm ERR! Remove the 'private' field from the package.json to publish it.我希望这个软件包只供组织成员使用。它既可以作为lerna monorepo中的本地私有包使用,也可以通过从GitHub包获得它而被Google函数使用。然而,没有其他人能够访问它。
这是有可能的吗?
问候
编辑:
我试图更新packages.json,删除private=true并确保将其发布到我的私有组织:
"publishConfig": {
"registry": "https://npm.pkg.github.com/:_authToken=xxxx --scope=@myorganization"
},我现在得到了错误:
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/@myorganization%2fcommon - The expected resource was not found.
npm ERR! 404
npm ERR! 404 '@myorganization/common@0.0.7' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)发布于 2020-10-16 11:16:31
我也面临着同样的问题。这就是对我有用的东西。
我必须在myorganization上创建GitHub上的组织(即您的示例中的common ),并且在该组织下创建一个与repo同名的回购(即在您的示例中为common),并且它起了作用。
https://stackoverflow.com/questions/63495295
复制相似问题