首页 > 解决方案 > npm 发布错误 - “npm ERR!403 403 Forbidden - 被禁止的包版本”

问题描述

我试图在没有 npm 的情况下发布我的包的新版本并收到此错误:

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/yolo-coords - You cannot publish over the previously published versions: 1.0.4.
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.

我的库很短,消息没有意义:

In most cases, you or one of your dependencies are requesting a package version that is forbidden by your security policy

标签: node.jsnpmnpm-publish

解决方案


问题是我忘了package.json修改版本,它是1.0.4

{
  "name": "yolo-coords",
  "version": "1.0.6"
}

推荐阅读