npm publish 上传时出现这个错误怎么解决

在尝试使用npm publish上传时遇到了错误,问题出在包名和版本号上。首先,错误提示表明包名“wodebaobao”有误,更改包名即可解决一部分问题。接着,如果继续遇到错误,可能是因为版本号已存在,需要更新版本号,例如从“1.0.0”更改为更高版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

npm publish 上传时出现这个错误怎么解决


```clike
PS G:\上课素材\xuexiziyiao\xuexi\jichuban\nodeJS\3node\wode-bao> npm publish
npm notice
npm notice package: wode-bao@1.0.0
npm notice === Tarball Contents ===
npm notice 291B  01自定义模块格式化时间.js
npm notice 542B  src/dataShiJan.js
npm notice 984B  src/htmlzhuanhuan.js
npm notice 343B  package.json
npm notice 1.8kB README.md
npm notice === Tarball Details ===
npm notice name:          wode-bao
npm notice version:       1.0.0
npm notice package size:  2.1 kB
npm notice unpacked size: 4.0 kB
npm notice shasum:        b3b319e6bb6c90bad711f1f2d29b615715384da3
npm notice integrity:     sha512-tMwohCLx1ns1M[...]Bd4MG6oVg9j7A==
npm notice total files:   5
npm notice
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/wode-bao - Package name too similar to existing packages; try renaming your package to '@teite/wode-bao' and publishing with 'npm publish --access=public' instead
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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-01-08T05_51_54_549Z-debug.log


**解决办法**

```clike
**Package name too similar to existing packages;**

这是包名错了 改变个包名就行了
“name”: “wodebaobao”

我改完之后又出现这个错误

 npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://registry.npmjs.org/wodebaobao - Cannot publish over previously published version "1.0.0".

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-01-08T06_35_09_064Z-debug.log
PS G:\上课素材\xuexiziyiao\xuexi\jichuban\nodeJS\3node\wodebaobao> npm publish

这是版本号有了 需要该一下版本号
Cannot publish over previously published version “1.0.0”.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值