错误:npm update

时间:2015-04-29 23:48:55

标签: node.js ubuntu npm ubuntu-14.04

我正在使用vagrant设置我的环境,当我使用sudo npm update时,我收到此错误。

npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "update"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path ../mime/cli.js
npm ERR! code EPROTO
npm ERR! errno -71

npm ERR! EPROTO, symlink '../mime/cli.js'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "update"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.7dead0fa1a1d874805ab6e477bd46e0e
npm ERR! code ETXTBSY
npm ERR! errno -26

npm ERR! ETXTBSY, rename 'npm-debug.log.7dead0fa1a1d874805ab6e477bd46e0e'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /vagrant/myapp/npm-debug.log

注1:我使用的是trusty32,我也使用节点0.12,npm 2.7.4和mongodb 2.6。

注意2:我无法安装mongoose和package.json中的默认快速生成器npm模块

UPDATE1:当我尝试&#34; sudo npm install mongoose -save&#34;

时出现Npm错误
npm ERR! tar.unpack untar error /home/vagrant/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/brace-expansion/1.1.0/package
.tgz
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "mongoose"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node_mod
ules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-pre-
gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/tes
t/extglob-ending-with-state-char.js
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modules/m
ongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_mo
dules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_module
s/minimatch/test/extglob-ending-with-state-char.js'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modul
es/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/nod
e_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_mo
dules/minimatch/test/extglob-ending-with-state-char.js']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node
_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-
pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch
/test/extglob-ending-with-state-char.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "mongoose"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node_mod
ules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-pre-
gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stre
am/lib/_stream_duplex.js
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modules/m
ongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_mo
dules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_module
s/readable-stream/lib/_stream_duplex.js'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modul
es/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/nod
e_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_mo
dules/readable-stream/lib/_stream_duplex.js']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node
_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-
pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-
stream/lib/_stream_duplex.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "mongoose"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.547bda60a6af6dbfaba7873fdc566e0c
npm ERR! code ETXTBSY
npm ERR! errno -26

npm ERR! ETXTBSY, rename 'npm-debug.log.547bda60a6af6dbfaba7873fdc566e0c'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "mongoose"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node_mod
ules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-pre-
gyp/node_modules/request/node_modules/combined-stream/node_modules/delayed-strea
m/lib/delayed_stream.js
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modules/m
ongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_mo
dules/node-pre-gyp/node_modules/request/node_modules/combined-stream/node_module
s/delayed-stream/lib/delayed_stream.js'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modul
es/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/nod
e_modules/node-pre-gyp/node_modules/request/node_modules/combined-stream/node_mo
dules/delayed-stream/lib/delayed_stream.js']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node
_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-
pre-gyp/node_modules/request/node_modules/combined-stream/node_modules/delayed-s
tream/lib/delayed_stream.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! tar.unpack untar error /home/vagrant/.npm/lodash._basetostring/3.0.0/pa
ckage.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/lodash._createpadding/3.6.0/p
ackage.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/lodash._createpadding/3.6.0/p
ackage.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/lodash._createpadding/3.6.0/p
ackage.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/lodash._basetostring/3.0.0/pa
ckage.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/lodash._basetostring/3.0.0/pa
ckage.tgz
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "mongoose"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node_mod
ules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-pre-
gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-vali
d/test/json-schema.js
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modules/m
ongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_mo
dules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/
is-my-json-valid/test/json-schema.js'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modul
es/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/nod
e_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modu
les/is-my-json-valid/test/json-schema.js']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node
_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-
pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-
valid/test/json-schema.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "mongoose"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node_mod
ules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-pre-
gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/bro
wser/bluebird.min.js
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modules/m
ongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_mo
dules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/
bluebird/js/browser/bluebird.min.js'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, open '/vagrant/myapp/node_modules/mongoose/node_modul
es/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/nod
e_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modu
les/bluebird/js/browser/bluebird.min.js']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/vagrant/myapp/node_modules/mongoose/node_modules/mongodb/node
_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/node_modules/node-
pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js
/browser/bluebird.min.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! tar.unpack untar error /home/vagrant/.npm/ansi-styles/2.0.1/package.tgz

npm ERR! tar.unpack untar error /home/vagrant/.npm/has-ansi/1.0.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/strip-ansi/2.0.1/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/escape-string-regexp/1.0.3/pa
ckage.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/supports-color/1.3.1/package.
tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/graceful-readlink/1.0.1/packa
ge.tgz

npm ERR! Please include the following file with any support request:
npm ERR!     /vagrant/myapp/npm-debug.log

UPDATE2:使用npm update切换到nvm效果更好但是我不能安装mongoose我得到了同样的错误

UPDATE3:我认为问题是因为路径

3 个答案:

答案 0 :(得分:3)

您使用的是旧版NPM,目前最新版本是2.8.4,目前您使用的是2.7.4。 2.7.5的发行说明提到了已修复的符号链接问题。

更新NPM应解决此问题,运行:

sudo npm install npm -g

答案 1 :(得分:2)

使用带有[Parsed_overlay_0 @ 0x7f9520518800] [framesync @ 0x7f9521021e28] Buffer queue overflow, dropping.

的sudo有两个问题
  1. 这样的99个问题。
  2. 这是security issue
  3. 最佳解决方案是使用节点版本管理器。我使用nvm。另一个名为n的人也存在。

    感觉就像是一些“倒退”的步骤而且我抵制它一两个星期,但是做出转换是值得的。

    注意:您应该卸载node.js的“sudo”版本,然后按照github页面上的描述安装nvm。

答案 2 :(得分:0)

此处2.1.7是您要安装的版本。

sudo npm install -g npm@2.1.7