Question

I am fairly new to npm and the publishing process, so not entirely surprised that this one has me stumped. I was trying to publish a brand new module. Everything seems to go fine until it hits a "cannot replace tarball" error. Has anyone seen this before? (note: inline links disabled because I'm new)

> ubuntu@udoo:~/projects/node/node_modules/ab-file-manager$ npm publish 
> npm http PUT ttps://registry.npmjs.org/ab-file-manager
> npm http 201 ttps://registry.npmjs.org/ab-file-manager
> npm http GET ttps://registry.npmjs.org/ab-file-manager
> npm http 200 ttps://registry.npmjs.org/ab-file-manager
> npm http PUT ttps://registry.npmjs.org/ab-file-manager/1.0.0/-tag/latest
> npm http 201 ttps://registry.npmjs.org/ab-file-manager/1.0.0/-tag/latest
> npm http GET ttps://registry.npmjs.org/ab-file-manager
> npm http 200 ttps://registry.npmjs.org/ab-file-manager
> npm http PUT ttps://registry.npmjs.org/ab-file-manager/-/ab-file-manager-1.0.0.tgz/-rev/2-3cc70430b72574c4ae86d9d1f52179d7
> npm http 403 ttps://registry.npmjs.org/ab-file-manager/-/ab-file-manager-1.0.0.tgz/-rev/2-3cc70430b72574c4ae86d9d1f52179d7
> npm ERR! publish failed Error: forbidden Cannot replace existing tarball attachment: ab-file-manager/-/ab-file-manager-1.0.0.tgz/-rev/2-3cc70430b72574c4ae86d9d1f52179d7
> npm ERR! publish failed     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:181:12)
> npm ERR! publish failed     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
> npm ERR! publish failed at Request.<anonymous> (/usr/lib/nodejs/request/main.js:525:16)
> npm ERR! publish failed     at Request.emit (events.js:67:17)
> npm ERR! publish failed     at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/main.js:484:14)
> npm ERR! publish failed at IncomingMessage.emit (events.js:88:20)
> npm ERR! publish failed at HTTPParser.onMessageComplete (http.js:137:23)
> npm ERR! publish failed     at CleartextStream.ondata (http.js:1150:24)
> npm ERR! publish failed     at CleartextStream._push (tls.js:375:27)
> npm ERR! publish failed     at SecurePair.cycle (tls.js:734:20)
> npm http GET ttps://registry.npmjs.org/ab-file-manager
> npm http 200 ttps://registry.npmjs.org/ab-file-manager
> npm http DELETE ttps://registry.npmjs.org/ab-file-manager/-rev/2-3cc70430b72574c4ae86d9d1f52179d7
> npm http 201 ttps://registry.npmjs.org/ab-file-manager/-rev/2-3cc70430b72574c4ae86d9d1f52179d7 - ab-file-manager@1.0.0
> npm ERR! Error: forbidden Cannot replace existing tarball attachment: ab-file-manager/-/ab-file-manager-1.0.0.tgz/-rev/2-3cc70430b72574c4ae86d9d1f52179d7
> npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:181:12)
> npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22) 
> npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:525:16) npm ERR!     at Request.emit (events.js:67:17) npm ERR!     at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/main.js:484:14)
> npm ERR!     at IncomingMessage.emit (events.js:88:20)
> npm ERR!     at HTTPParser.onMessageComplete (http.js:137:23)
> npm ERR!     at CleartextStream.ondata (http.js:1150:24)
> npm ERR!     at CleartextStream._push (tls.js:375:27)
> npm ERR!     at SecurePair.cycle (tls.js:734:20) npm ERR! You may report this log at: 
> npm ERR!     <ttp://bugs.debian.org/npm>
> npm ERR! or use
> npm ERR! reportbug --attach /home/ubuntu/projects/node/node_modules/ab-file-manager/npm-debug.log npm
> npm ERR!
> npm ERR! System Linux 3.0.35
> npm ERR! command "node" "/usr/bin/npm" "publish"
> npm ERR! cwd /home/ubuntu/projects/node/node_modules/ab-file-manager
> npm ERR! node -v v0.6.12
> npm ERR! npm -v 1.1.4
> npm ERR! message forbidden Cannot replace existing tarball attachment: ab-file-manager/-/ab-file-manager-1.0.0.tgz/-rev/2-3cc70430b72574c4ae86d9d1f52179d7
> npm ERR!
> npm ERR! Additional logging details can be found in:
> npm ERR! /home/ubuntu/projects/node/node_modules/ab-file-manager/npm-debug.log 
> npm not ok

Updating to node 0.10.0 did the trick thanks. Note that I'm installing nodejs and npm on the UDOO running Ubuntu Linaro. With that there were a whole host of other issues I had to work through as well. Afterward I believe I still have both versions of nodejs installed on my box, but the correct executable runs. Here's the laundry list of commands I ran:

sudo apt-get update
sudo apt-get install libcurl3-gnutls
sudo apt-get install python-pycurl
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
cd /usr/local/src
sudo wget http://nodejs.org/dist/v0.10.0/node-v0.10.0.tar.gz
sudo tar -xvzf node-v0.10.0.tar.gz
cd node-v0.10.0-linux-x86
sudo ./configure --without-snapshot (see the note in one of the links regarding Python, and the npm segmentation fault)
sudo make
sudo make install
sudo ln -s /usr/local/bin/node /usr/bin/node
node --version
export NODE_PATH=/usr/local/lib/node_modules (or wherever your graceful-fs is located)

Some of these steps might not actually be necessary, depending on your setup. YMMV

Here are links to the pages from which I was able to piece together an amalgam of a solution:

https://askubuntu.com/questions/49390/how-do-i-install-the-latest-version-of-node-js

Node.js source code build giving segmentation fault on ARM

NPM, cannot find 'graceful-fs', no matter what I do

Before executing 'node publish' again I had to bump up the module's version in the package.json file. Then it worked fine:

npm http PUT https://registry.npmjs.org/ab-file-manager
npm http 201 https://registry.npmjs.org/ab-file-manager
npm http GET https://registry.npmjs.org/ab-file-manager
npm http 200 https://registry.npmjs.org/ab-file-manager
npm http PUT https://registry.npmjs.org/ab-file-manager/-/ab-file-manager-1.0.1.tgz/-rev/6-d48cb2d98feca4cdcd874c72f345e59b
npm http 201 https://registry.npmjs.org/ab-file-manager/-/ab-file-manager-1.0.1.tgz/-rev/6-d48cb2d98feca4cdcd874c72f345e59b
npm http PUT https://registry.npmjs.org/ab-file-manager/1.0.1/-tag/latest
npm http 201 https://registry.npmjs.org/ab-file-manager/1.0.1/-tag/latest
+ ab-file-manager@1.0.1
Was it helpful?

Solution

> npm ERR! node -v v0.6.12
> npm ERR! npm -v 1.1.4

You're using an ancient version of node.js and npm.

Please install node 0.10 and try again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top