Description
Affected Packages
https://github.com/shinokada/svelte-heros-v2
Problem
git add .
git commit -m 'my message'
npx changeset
This works and I get a PR.
- Then I go to the repo and select
Rebase and Merge
on GitHub Pull request:
- Error
The GitHub action runs and return the following error:
...
...
> Using @sveltejs/adapter-node
✔ done
🦋 info npm info svelte-heros-v2
🦋 info svelte-heros-v2 is being published because our local version (0.4.1) has not been published on npm
🦋 info Publishing "svelte-heros-v2" at "0.4.1"
🦋 error an error occurred while publishing svelte-heros-v2: E404 Not Found - PUT https://registry.npmjs.org/svelte-heros-v2 - Not found
🦋 error
🦋 error '[email protected]' is not in this registry.
🦋 error
🦋 error Note that you can also install from a
🦋 error tarball, folder, http url, or git url.
🦋 error npm notice Publishing to https://registry.npmjs.org/
🦋 error npm ERR! code E404
🦋 error npm ERR! 404 Not Found - PUT https://registry.npmjs.org/svelte-heros-v2 - Not found
🦋 error npm ERR! 404
🦋 error npm ERR! 404 '[email protected]' is not in this registry.
🦋 error npm ERR! 404
🦋 error npm ERR! 404 Note that you can also install from a
🦋 error npm ERR! 404 tarball, folder, http url, or git url.
🦋 error {
🦋 error "error": {
🦋 error "code": "E404",
🦋 error "summary": "Not Found - PUT https://registry.npmjs.org/svelte-heros-v2 - Not found",
🦋 error "detail": "\n '[email protected]' is not in this registry.\n\nNote that you can also install from a\ntarball, folder, http url, or git url."
🦋 error }
🦋 error }
🦋 error
🦋 error npm ERR! A complete log of this run can be found in:
🦋 error npm ERR! /home/runner/.npm/_logs/2022-09-09T01_49_08_107Z-debug-0.log
🦋 error
🦋 error packages failed to publish:
🦋 [email protected]
Error: The process '/opt/hostedtoolcache/node/16.17.0/x64/bin/npm' failed with exit code 1
Error: The process '/opt/hostedtoolcache/node/16.17.0/x64/bin/npm' failed with exit code 1
at m._setResult (/home/runner/work/_actions/changesets/action/v1/dist/index.js:102:[72](https://github.com/shinokada/svelte-heros-v2/runs/8261994145?check_suite_focus=true#step:6:73)58)
at m.CheckComplete (/home/runner/work/_actions/changesets/action/v1/dist/index.js:102:66[86](https://github.com/shinokada/svelte-heros-v2/runs/8261994145?check_suite_focus=true#step:6:87))
at ChildProcess.<anonymous> (/home/runner/work/_actions/changesets/action/v1/dist/index.js:102:5723)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1022:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:2[87](https://github.com/shinokada/svelte-heros-v2/runs/8261994145?check_suite_focus=true#step:6:88):5)
It says that E404 Not Found - PUT https://registry.npmjs.org/svelte-heros-v2, but it exists.
My release.yml:
push:
branhes: ['main']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm i
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: install
run: npm install
- name: Create Release Pull Request or Publish to npm
# https://github.com/changesets/action
uses: changesets/action@v1
with:
# this expects you to have a script called release which does a build for your packages and calls changeset publish
# release & version-packages:
# "release": "npm run package && npx changeset publish",
# "version-packages": "npx changeset version"
version: npm run version-packages
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
I use changeset as followings in scripts, package.json:
"release": "npm run build && npx changeset publish",
"version-packages": "npx changeset version"
What am I doing wrong here?
I appreciate your inputs.
Proposed solution
Additional info
- I disabled Require two-factor authentication for write actions in NPM 2FA.
- My .npmrc according to https://docs.github.com/en/packages/quickstart
@shinokada:registry=https://npm.pkg.github.com
- I have the following in the package.json according to https://docs.github.com/en/packages/quickstart
"publishConfig": {
"@shinokada:registry": "https://npm.pkg.github.com"
}
Metadata
Assignees
Labels
No labels