File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,12 +17,17 @@ jobs:
1717 registry-url : ' https://registry.npmjs.org'
1818
1919 - name : Install dependencies
20- run : npm install
20+ run : npm ci
21+
22+ - name : Verify npm auth (debug)
23+ run : npm whoami
24+ env :
25+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
2126
2227 - name : Build
2328 run : npm run build
2429
2530 - name : Publish to NPM
26- run : npm publish --access public
31+ run : npm publish --provenance -- access public
2732 env :
2833 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1+ //registry.npmjs.org/:_authToken = ${ NPM_TOKEN }
2+ registry = https://registry.npmjs.org/
3+ always-auth = true
Original file line number Diff line number Diff line change @@ -202,14 +202,29 @@ git push origin develop
202202
2032031 . Generate NPM token:
204204 - Go to https://www.npmjs.com/settings/YOUR_USERNAME/tokens
205- - Create "Automation" token
205+ - Create ** "Automation" token** (NOT "Publish" / NOT "Read-only")
206206 - Copy the token
207207
2082082 . Add to GitHub Secrets:
209209 - Go to repository Settings → Secrets → Actions
210210 - Add secret: ` NPM_TOKEN `
211211 - Paste the token
212212
213+ ### If ` npm publish ` fails with ` EOTP `
214+
215+ If you see this in GitHub Actions:
216+
217+ ``` text
218+ npm error code EOTP
219+ npm error This operation requires a one-time password from your authenticator.
220+ ```
221+
222+ That means your NPM account requires 2FA for publishing and the token you provided can’t publish without an OTP prompt.
223+
224+ Fix:
225+ - Use an ** Automation token** for ` NPM_TOKEN ` (recommended for CI)
226+ - Or change NPM 2FA setting to ** “authorization only”** (so CI publish doesn’t require OTP)
227+
213228### Publish via GitHub Release
214229
215230``` bash
You can’t perform that action at this time.
0 commit comments