我正在嘗試將作用域包發布到 npm,但我在 CLI 上不斷收到此錯誤:
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/@username/dynamic-ui-elements - Forbidden
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/cutler/.npm/_logs/2022-05-16T23_08_36_735Z-debug.log
我已經查看了 整個互聯網 試圖解決這個問題,但我所看到的所有建議都沒有奏效。
- 我在 CLI 上登錄
- 我的 npm 電子郵件已通過驗證
- 沒有其他同名的包,因為我將其發布到我的用戶名范圍內,而且我從未發布過任何其他包
- 我已經嘗試過該命令
npm publish --access public以及npm publish --access=public - 2FA 已啟用
關于 2FA,我嘗試了檢查和不檢查“要求對寫入操作進行雙重身份驗證”的情況。當它被檢查時,我收到提示輸入一次性密碼,而不是上述錯誤,但是在輸入從我的谷歌身份驗證器應用程式生成的代碼后,我再次得到 E403。
這 兩個問題反映了我自己的問題,但都沒有得到回答。我是否使用了錯誤的身份驗證器?有沒有我缺少的設定?
這是我的package.json:
{
"name": "@username/dynamic-ui-elements",
"version": "1.0.0",
"description": "Some dynamic UI elements to transform your HTML",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack",
"start": "webpack serve --open"
},
"repository": {
"type": "git",
"url": "git https://github.com/CutlerSheridan/dynamic-ui-elements.git"
},
"author": "Cutler Sheridan <[email protected]>",
"license": "ISC",
"files": [
"src/dynamicUi.js",
"README.md"
],
"bugs": {
"url": "https://github.com/CutlerSheridan/dynamic-ui-elements/issues"
},
"homepage": "https://github.com/CutlerSheridan/dynamic-ui-elements#readme",
"devDependencies": {
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.0"
}
}
uj5u.com熱心網友回復:
盡管閱讀了package.json100 次,但問題是我沒有將自動生成的用戶名更改"name": "@username/dynamic-ui-elements"為我的真實用戶名。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/478999.html
標籤:javascript json npm 命令行界面 npm-发布
上一篇:我可以在沒有npmrun命令的情況下運行npm包嗎?
下一篇:在本地運行開源代碼-vscode
