[英]github action for npm publish fails
Goal目标
I have manually published an open source lib to registry.npmjs.org and I want future releases to be automatically published using GitHub Actions.我已经手动将一个开源库发布到 registry.npmjs.org,我希望未来的版本能够使用 GitHub Actions 自动发布。 I have no prior experience with GitHub actions.我之前没有 GitHub 操作的经验。
What I have done so far到目前为止我做了什么
I have put the standard GitHub action into the repository which GitHub provides for that purpose ( unchanged ).我已将标准 GitHub 操作放入 GitHub 为此目的提供的存储库中(未更改)。 In its last line, it takes the automation token from npmjs.com which I have defined on the repo as environment secret NPM_TOKEN
.在最后一行中,它从npmjs.com中获取自动化令牌,我在回购协议中将其定义为环境机密NPM_TOKEN
。 It shows up in the repo's secrects page.它显示在回购协议的秘密页面中。
Run npm publish
...
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in.
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-01-08T00_20_52_834Z-debug.log
Error: Process completed with exit code 1.
Despite extensive web search, I do not understand尽管广泛搜索 web,我还是不明白
npm adduser
, does it indicate that the automation token has not been properly picked up?为什么 npm publish 需要npm adduser
,是否表示自动化令牌没有被正确提取? After all, the action is executed on a CI node on which I couldn't npm login
.毕竟,该操作是在我无法npm login
的 CI 节点上执行的。 And the npm-publish.yml
or its documentation shows no hint that user details need to be provided for authentication. npm-publish.yml
或其文档没有显示需要提供用户详细信息以进行身份验证的提示。I had some endeavours and got a similar problem.我做了一些努力并遇到了类似的问题。 Consider two things to look at:考虑两件事:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.