【发布时间】:2022-06-22 23:50:17
【问题描述】:
我正在尝试将一个新包发布到 npm,public。
我有以下工作流程:
# This workflow will run tests using node and then publish a package to GitHub
Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Node.js Package
on:
release:
types: [created]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm login
- run: npm config set access public
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
但我收到以下错误:
npm notice
npm notice ???? @orgname/pdf-image@1.2.2
npm notice === Tarball Contents ===
npm notice 135B Dockerfile
npm notice 135B Dockerfile12
npm notice 1.1kB LICENSE
npm notice 6.8kB index.js
npm notice 5.9kB tests/test-main.js
npm notice 530B package.json
npm notice 2.1kB README.md
npm notice 325.2kB tests/test.pdf
npm notice 1.1kB .github/workflows/node.js.yml
npm notice 664B .github/workflows/npm-publish.yml
npm notice === Tarball Details ===
npm notice name: @orgname/pdf-image
npm notice version: 1.2.2
npm notice package size: 322.6 kB
npm notice unpacked size: 343.6 kB
npm notice shasum: d362e3a6c95d12b2329ed608495c45580bb8de15
npm notice integrity: sha512-OpurprtbmR7By[...]V553ykjYtaOrA==
npm notice total files: 10
npm notice
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@orgname%2fpdf-image - Not found
npm ERR! 404
npm ERR! 404 '@orgname/pdf-image@1.2.2' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
请告知我该如何解决这个问题。
【问题讨论】:
-
您是否需要将
@orgname替换为您的实际组织名称?还是您添加它是为了混淆您的组织名称 SO? -
仅用于混淆目的。
-
相同的命令在本地工作吗?
-
没有尝试,考虑过,但希望从工作流中释放第一个标签。
标签: github-actions npm-publish