npm / npm

This repository is moving to: https://github.com/npm/cli
http://npm.community
17.53k stars 3.02k forks source link

"You cannot publish over the previously published version 1.0.1." #17310

Open MarsCWD opened 7 years ago

MarsCWD commented 7 years ago

i just try to publish a local plugin, but meet a problem:

npm ERR! publish Failed PUT 403 npm ERR! code E403 npm ERR! "You cannot publish over the previously published version 1.0.1." : marscwd

npm ERR! A complete log of this run can be found in: npm ERR! /Users/chen/.npm/_logs/2017-06-19T07_29_16_485Z-debug.log

the debug.log console is:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'publish', 1 verbose cli '/Users/chen/Desktop/project/plugin/cordova-plugin-alertview' ] 2 info using npm@5.0.3 3 info using node@v6.11.0 4 verbose npm-session b1f3f43285646345 5 verbose publish [ '/Users/chen/Desktop/project/plugin/cordova-plugin-alertview' ] 6 info lifecycle marscwd@1.0.1~prepublish: marscwd@1.0.1 7 silly lifecycle marscwd@1.0.1~prepublish: no script for prepublish, continuing 8 info lifecycle marscwd@1.0.1~prepare: marscwd@1.0.1 9 silly lifecycle marscwd@1.0.1~prepare: no script for prepare, continuing 10 info lifecycle marscwd@1.0.1~prepublishOnly: marscwd@1.0.1 11 silly lifecycle marscwd@1.0.1~prepublishOnly: no script for prepublishOnly, continuing 12 info lifecycle marscwd@1.0.1~prepack: marscwd@1.0.1 13 silly lifecycle marscwd@1.0.1~prepack: no script for prepack, continuing 14 verbose tar pack [ '/var/folders/64/jbh6hgqx0hvdysshk0n_s8n00000gn/T/npm-9715-477e4ade/tmp/packing-2e184d17/package.tgz', 14 verbose tar pack '/Users/chen/Desktop/project/plugin/cordova-plugin-alertview' ] 15 verbose tarball /var/folders/64/jbh6hgqx0hvdysshk0n_s8n00000gn/T/npm-9715-477e4ade/tmp/packing-2e184d17/package.tgz 16 verbose folder /Users/chen/Desktop/project/plugin/cordova-plugin-alertview 17 info lifecycle marscwd@1.0.1~postpack: marscwd@1.0.1 18 silly lifecycle marscwd@1.0.1~postpack: no script for postpack, continuing 19 verbose getPublishConfig undefined 20 silly mapToRegistry name marscwd 21 silly mapToRegistry using default registry 22 silly mapToRegistry registry https://registry.npmjs.org/ 23 silly mapToRegistry data { type: 'tag', 23 silly mapToRegistry registry: true, 23 silly mapToRegistry where: undefined, 23 silly mapToRegistry raw: 'marscwd', 23 silly mapToRegistry name: 'marscwd', 23 silly mapToRegistry escapedName: 'marscwd', 23 silly mapToRegistry scope: undefined, 23 silly mapToRegistry rawSpec: '', 23 silly mapToRegistry saveSpec: null, 23 silly mapToRegistry fetchSpec: 'latest', 23 silly mapToRegistry gitRange: undefined, 23 silly mapToRegistry gitCommittish: undefined, 23 silly mapToRegistry hosted: undefined } 24 silly mapToRegistry uri https://registry.npmjs.org/marscwd 25 verbose publish registryBase https://registry.npmjs.org/ 26 silly publish uploading /var/folders/64/jbh6hgqx0hvdysshk0n_s8n00000gn/T/npm-9715-477e4ade/tmp/fromDir-7ef180e2/package.tgz 27 verbose request uri https://registry.npmjs.org/marscwd 28 verbose request sending authorization for write operation 29 info attempt registry request try #1 at 15:29:14 30 verbose request using bearer token for auth 31 verbose request id 856a4d20b867df32 32 http request PUT https://registry.npmjs.org/marscwd 33 http 403 https://registry.npmjs.org/marscwd 34 verbose headers { 'content-type': 'application/json', 34 verbose headers 'cache-control': 'max-age=300', 34 verbose headers 'content-length': '95', 34 verbose headers 'accept-ranges': 'bytes', 34 verbose headers date: 'Mon, 19 Jun 2017 07:29:16 GMT', 34 verbose headers via: '1.1 varnish', 34 verbose headers connection: 'keep-alive', 34 verbose headers 'x-served-by': 'cache-hkg6824-HKG', 34 verbose headers 'x-cache': 'MISS', 34 verbose headers 'x-cache-hits': '0', 34 verbose headers 'x-timer': 'S1497857356.559970,VS0,VE742', 34 verbose headers vary: 'Accept-Encoding' } 35 error publish Failed PUT 403 36 verbose stack Error: "You cannot publish over the previously published version 1.0.1." : marscwd 36 verbose stack at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:308:12) 36 verbose stack at RegClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:296:14) 36 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:216:14) 36 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:188:22) 36 verbose stack at emitTwo (events.js:106:13) 36 verbose stack at Request.emit (events.js:191:7) 36 verbose stack at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1171:10) 36 verbose stack at emitOne (events.js:96:13) 36 verbose stack at Request.emit (events.js:188:7) 36 verbose stack at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1091:12) 36 verbose stack at IncomingMessage.g (events.js:292:16) 36 verbose stack at emitNone (events.js:91:20) 36 verbose stack at IncomingMessage.emit (events.js:185:7) 36 verbose stack at endReadableNT (_stream_readable.js:974:12) 36 verbose stack at _combinedTickCallback (internal/process/next_tick.js:80:11) 36 verbose stack at process._tickCallback (internal/process/next_tick.js:104:9) 37 verbose statusCode 403 38 verbose pkgid marscwd 39 verbose cwd /Users/chen/Desktop/project/plugin 40 verbose Darwin 16.0.0 41 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "publish" "/Users/chen/Desktop/project/plugin/cordova-plugin-alertview" 42 verbose node v6.11.0 43 verbose npm v5.0.3 44 error code E403 45 error "You cannot publish over the previously published version 1.0.1." : marscwd 46 verbose exit [ 1, true ]

karimsa commented 7 years ago

You already have published v1.0.1 at 2017-06-19T06:13:04.730Z.

npm has deprecated the overwriting of existing package versions (a while ago - due to both good practice and since it was never really technically possible to overwrite a package version).

You have to bump your version number using npm version before publishing.