我对npm和发布过程都很陌生,所以对于这个让我感到困惑并不感到惊讶。我试图发布一个全新的模块。一切似乎都没问题,直到遇到“无法替换tarball”的错误。谁看过这个吗? (注意:内联链接被禁用,因为我是新手)
> 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
更新到节点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)
根据您的设置,实际上可能不需要其中一些步骤。 YMMV
以下是我能够将解决方案的混合物拼凑在一起的页面的链接:
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
在再次执行'node publish'之前,我不得不在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
+ ab-file-manager@1.0.1
答案 0 :(得分:1)
> npm ERR! node -v v0.6.12
> npm ERR! npm -v 1.1.4
您使用的是古老版本的node.js和npm。
请安装节点0.10然后重试。