Skip to content

Commit 1b439ff

Browse files
committed
fix: Correct NPM publishing command in workflows
- Fixed npm publish command to use package.json instead of package-npm.json - Updated both npm-publish-only.yml and publish-all.yml workflows - Now properly replaces package.json with NPM version before publishing - This resolves the 404 error when trying to publish package-npm.json as a package name The workflow now: 1. Creates a copy of package.json with unscoped name 2. Replaces the original package.json with NPM version 3. Publishes using standard npm publish command
1 parent e228617 commit 1b439ff

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/npm-publish-only.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ jobs:
5454
delete pkg.publishConfig;
5555
require('fs').writeFileSync('package-npm.json', JSON.stringify(pkg, null, 2));
5656
"
57+
# Replace the original package.json with the NPM version
58+
mv package-npm.json package.json
5759
5860
- name: Publish to NPM
59-
run: npm publish package-npm.json
61+
run: npm publish
6062
env:
6163
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6264

.github/workflows/publish-all.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ jobs:
5656
delete pkg.publishConfig;
5757
require('fs').writeFileSync('package-npm.json', JSON.stringify(pkg, null, 2));
5858
"
59+
# Replace the original package.json with the NPM version
60+
mv package-npm.json package.json
5961
6062
- name: Publish to NPM
61-
run: npm publish --package-lock=false
63+
run: npm publish
6264
env:
6365
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6466

0 commit comments

Comments
 (0)