2014-03-03 54 views
0

我對npm和發佈過程相當陌生,所以不會完全意外地發現這個問題讓我很難過。我試圖發佈一個全新的模塊。一切似乎都很好,直到它遇到「無法替代tarball」的錯誤。有沒有人見過這個? (注意:內聯鏈接被禁用,因爲我是新的)npm發佈不能替代現有的tarball

> [email protected]:~/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 - [email protected] 
> 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 

更新到節點0.10.0做了竅門謝謝。請注意,我正在運行Ubuntu Linaro的UDOO上安裝nodejs和npm。有了這些,我還需要解決一系列其他問題。之後我相信我的機器上仍然安裝了兩個版本的nodejs,但是正確的可執行文件運行。以下是我運行的命令清單:

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) 

根據您的設置,其中一些步驟實際上可能不是必需的。因人而異

這裏是鏈接到的網頁從中我能拼湊出一個解決方案的混合體:

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

執行前「節點發布」我不得不在package.json文件中找到模塊的版本。然後,它工作得很好:

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 
+ [email protected] 

回答

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

你如何使用Node.js和NPM的一個古老的版本。

請安裝節點0.10並重試。