node.js-无法使用节点npm安装任何软件包

我正在尝试通过npm安装一些节点软件包,但不会成功。我已经尝试安装/卸载/更新节点,但是似乎没有任何效果。

我正在使用ubuntu 12.04-这是我尝试安装软件包的方式:

npm install underscore

npm http GET http://registry.npmjs.org/underscore
npm http 404 http://registry.npmjs.org/underscore
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <html>
npm ERR!   <head>
npm ERR!     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
npm ERR!     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
npm ERR!   </head>
npm ERR!   <body style="display: none;">
npm ERR!     <script type="text/javascript">
npm ERR! var reg = 'sedonewreg';
npm ERR! document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
npm ERR!     </script>
npm ERR!  </body>
npm ERR! </html>
npm ERR! 
npm ERR!     at Object.parse (native)
npm ERR!     at RegClient.<anonymous> (/home/smanastirliu/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:235:23)
npm ERR!     at Request.self.callback (/home/smanastirliu/local/lib/node_modules/npm/node_modules/request/index.js:142:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/home/smanastirliu/local/lib/node_modules/npm/node_modules/request/index.js:856:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/home/smanastirliu/local/lib/node_modules/npm/node_modules/request/index.js:808:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:895:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/smanastirliu/local/bin/node" "/home/smanastirliu/local/bin/npm" "install" "underscore"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! type unexpected_token
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR!  { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/smanastirliu/local/bin/node" "/home/smanastirliu/local/bin/npm" "install" "underscore"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/smanastirliu/npm-debug.log
npm ERR! not ok code 0
smanastirliu@sviluppo69:~$ sudo npm install underscore
[sudo] password for smanastirliu: 
npm http GET http://registry.npmjs.org/underscore
npm http 404 http://registry.npmjs.org/underscore
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <html>
npm ERR!   <head>
npm ERR!     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
npm ERR!     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
npm ERR!   </head>
npm ERR!   <body style="display: none;">
npm ERR!     <script type="text/javascript">
npm ERR! var reg = 'sedonewreg';
npm ERR! document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
npm ERR!     </script>
npm ERR!  </body>
npm ERR! </html>
npm ERR! 
npm ERR!     at Object.parse (native)
npm ERR!     at RegClient.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:235:23)
npm ERR!     at Request.self.callback (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:142:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:856:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:808:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:895:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "underscore"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! type unexpected_token
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/smanastirliu/npm-debug.log
npm ERR! not ok code 0

这是debug.log:

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   'install',
1 verbose cli   'underscore' ]
2 info using npm@1.2.18
3 info using node@v0.10.5
4 verbose node symlink /usr/local/bin/node
5 verbose read json /home/smanastirliu/package.json
6 verbose read json /home/smanastirliu/package.json
7 verbose cache add [ 'underscore', null ]
8 verbose cache add name=undefined spec="underscore" args=["underscore",null]
9 verbose parsed url { protocol: null,
9 verbose parsed url   slashes: null,
9 verbose parsed url   auth: null,
9 verbose parsed url   host: null,
9 verbose parsed url   port: null,
9 verbose parsed url   hostname: null,
9 verbose parsed url   hash: null,
9 verbose parsed url   search: null,
9 verbose parsed url   query: null,
9 verbose parsed url   pathname: 'underscore',
9 verbose parsed url   path: 'underscore',
9 verbose parsed url   href: 'underscore' }
10 silly lockFile 64bc6893-underscore underscore
11 verbose lock underscore /home/smanastirliu/.npm/64bc6893-underscore.lock
12 silly lockFile 64bc6893-underscore underscore
13 silly lockFile 64bc6893-underscore underscore
14 verbose addNamed [ 'underscore', '' ]
15 verbose addNamed [ null, '' ]
16 silly lockFile 7629b758-underscore underscore@
17 verbose lock underscore@ /home/smanastirliu/.npm/7629b758-underscore.lock
18 silly addNameRange { name: 'underscore', range: '', hasData: false }
19 verbose url raw underscore
20 verbose url resolving [ 'http://registry.npmjs.org/', './underscore' ]
21 verbose url resolved http://registry.npmjs.org/underscore
22 info trying registry request attempt 1 at 16:38:48
23 http GET http://registry.npmjs.org/underscore
24 http 404 http://registry.npmjs.org/underscore
25 verbose bad json <html>
25 verbose bad json   <head>
25 verbose bad json     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25 verbose bad json     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
25 verbose bad json   </head>
25 verbose bad json   <body style="display: none;">
25 verbose bad json     <script type="text/javascript">
25 verbose bad json var reg = 'sedonewreg';
25 verbose bad json document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
25 verbose bad json     </script>
25 verbose bad json  </body>
25 verbose bad json </html>
26 error registry error parsing json
27 silly registry.get cb [ 404,
27 silly registry.get   { date: 'Mon, 29 Apr 2013 14:39:02 GMT',
27 silly registry.get     server: 'Apache',
27 silly registry.get     'content-length': '521',
27 silly registry.get     connection: 'close',
27 silly registry.get     'content-type': 'text/html; charset=UTF-8' } ]
28 silly lockFile 7629b758-underscore underscore@
29 silly lockFile 7629b758-underscore underscore@
30 error SyntaxError: Unexpected token <
30 error <html>
30 error   <head>
30 error     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
30 error     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
30 error   </head>
30 error   <body style="display: none;">
30 error     <script type="text/javascript">
30 error var reg = 'sedonewreg';
30 error document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
30 error     </script>
30 error  </body>
30 error </html>
30 error
30 error     at Object.parse (native)
30 error     at RegClient.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:235:23)
30 error     at Request.self.callback (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:142:22)
30 error     at Request.EventEmitter.emit (events.js:98:17)
30 error     at Request.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:856:14)
30 error     at Request.EventEmitter.emit (events.js:117:20)
30 error     at IncomingMessage.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:808:12)
30 error     at IncomingMessage.EventEmitter.emit (events.js:117:20)
30 error     at _stream_readable.js:895:16
30 error     at process._tickCallback (node.js:415:13)
31 error If you need help, you may report this log at:
31 error     <http://github.com/isaacs/npm/issues>
31 error or email it to:
31 error     <npm-@googlegroups.com>
32 error System Linux 3.5.0-27-generic
33 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "underscore"
34 error cwd /home/smanastirliu
35 error node -v v0.10.5
36 error npm -v 1.2.18
37 error type unexpected_token
38 verbose exit [ 1, true ]

业力的另一个例子:

sudo npm install karma
npm http GET http://registry.npmjs.org/karma
npm http 304 http://registry.npmjs.org/karma
npm http GET http://registry.npmjs.org/http-proxy
npm http GET http://registry.npmjs.org/glob
npm http GET http://registry.npmjs.org/minimatch
npm http GET http://registry.npmjs.org/optimist/0.3.5
npm http GET http://registry.npmjs.org/coffee-script
npm http GET http://registry.npmjs.org/rimraf
npm http GET http://registry.npmjs.org/xmlbuilder/0.4.2
npm http GET http://registry.npmjs.org/q
npm http GET http://registry.npmjs.org/LiveScript/1.0.1
npm http GET http://registry.npmjs.org/colors/0.6.0-1
npm http GET http://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http GET http://registry.npmjs.org/istanbul/0.1.22
npm http GET http://registry.npmjs.org/growly
npm http GET http://registry.npmjs.org/lodash
npm http GET http://registry.npmjs.org/pause/0.0.1
npm http GET http://registry.npmjs.org/mime
npm http GET http://registry.npmjs.org/log4js
npm http GET http://registry.npmjs.org/socket.io
npm http GET http://registry.npmjs.org/chokidar
npm http 304 http://registry.npmjs.org/minimatch
npm http 304 http://registry.npmjs.org/glob
npm http 304 http://registry.npmjs.org/optimist/0.3.5
npm http 304 http://registry.npmjs.org/coffee-script
npm http 304 http://registry.npmjs.org/xmlbuilder/0.4.2
npm http 304 http://registry.npmjs.org/rimraf
npm http 304 http://registry.npmjs.org/q
npm http 304 http://registry.npmjs.org/LiveScript/1.0.1
npm http 304 http://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http 304 http://registry.npmjs.org/growly
npm http 304 http://registry.npmjs.org/istanbul/0.1.22
npm http 304 http://registry.npmjs.org/colors/0.6.0-1
npm http 304 http://registry.npmjs.org/lodash
npm http 304 http://registry.npmjs.org/mime
npm http 304 http://registry.npmjs.org/pause/0.0.1
npm http 304 http://registry.npmjs.org/log4js
npm http 304 http://registry.npmjs.org/socket.io
npm http 304 http://registry.npmjs.org/chokidar
npm http 200 http://registry.npmjs.org/http-proxy
npm http GET http://registry.npmjs.org/http-proxy/-/http-proxy-0.10.2.tgz
npm http 200 http://registry.npmjs.org/http-proxy/-/http-proxy-0.10.2.tgz
npm http GET http://registry.npmjs.org/graceful-fs
npm http GET http://registry.npmjs.org/lru-cache
npm http GET http://registry.npmjs.org/sigmund
npm http GET http://registry.npmjs.org/graceful-fs
npm http GET http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/wordwrap
npm http GET http://registry.npmjs.org/base64id/0.1.0
npm http GET http://registry.npmjs.org/socket.io-client/0.9.11
npm http GET http://registry.npmjs.org/policyfile/0.0.4
npm http GET http://registry.npmjs.org/redis/0.7.3
npm http GET http://registry.npmjs.org/async/0.1.15
npm http GET http://registry.npmjs.org/dequeue/1.0.3
npm http GET http://registry.npmjs.org/prelude-ls
npm http GET http://registry.npmjs.org/semver
npm http GET http://registry.npmjs.org/readable-stream
npm http GET http://registry.npmjs.org/esprima
npm http GET http://registry.npmjs.org/escodegen
npm http GET http://registry.npmjs.org/handlebars
npm http GET http://registry.npmjs.org/mkdirp
npm http GET http://registry.npmjs.org/nopt
npm http GET http://registry.npmjs.org/fileset
npm http GET http://registry.npmjs.org/which
npm http GET http://registry.npmjs.org/async
npm http GET http://registry.npmjs.org/abbrev
npm http GET http://registry.npmjs.org/wordwrap
npm http 200 http://registry.npmjs.org/graceful-fs
npm http GET http://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.0.tgz
npm http 200 http://registry.npmjs.org/graceful-fs
npm http 200 http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http GET http://registry.npmjs.org/pkginfo
npm http GET http://registry.npmjs.org/utile
npm http 200 http://registry.npmjs.org/base64id/0.1.0
npm http GET http://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http 200 http://registry.npmjs.org/wordwrap
npm http GET http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 http://registry.npmjs.org/lru-cache
npm http GET http://registry.npmjs.org/lru-cache/-/lru-cache-2.3.0.tgz
npm http 200 http://registry.npmjs.org/policyfile/0.0.4
npm http GET http://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 http://registry.npmjs.org/dequeue/1.0.3
npm http 200 http://registry.npmjs.org/async/0.1.15
npm http GET http://registry.npmjs.org/dequeue/-/dequeue-1.0.3.tgz
npm http GET http://registry.npmjs.org/async/-/async-0.1.15.tgz
npm http 200 http://registry.npmjs.org/socket.io-client/0.9.11
npm http GET http://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.11.tgz
npm http 200 http://registry.npmjs.org/redis/0.7.3
npm http GET http://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm http 200 http://registry.npmjs.org/prelude-ls
npm http GET http://registry.npmjs.org/prelude-ls/-/prelude-ls-0.6.0.tgz
npm http 200 http://registry.npmjs.org/semver
npm http GET http://registry.npmjs.org/semver/-/semver-1.1.4.tgz
npm http 200 http://registry.npmjs.org/esprima
npm http GET http://registry.npmjs.org/esprima/-/esprima-0.9.9.tgz
npm http 200 http://registry.npmjs.org/mkdirp
npm http GET http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 http://registry.npmjs.org/handlebars
npm http GET http://registry.npmjs.org/handlebars/-/handlebars-1.0.10.tgz
npm http 200 http://registry.npmjs.org/fileset
npm http GET http://registry.npmjs.org/fileset/-/fileset-0.1.5.tgz
npm http 200 http://registry.npmjs.org/nopt
npm http GET http://registry.npmjs.org/nopt/-/nopt-2.0.0.tgz
npm http 200 http://registry.npmjs.org/which
npm http GET http://registry.npmjs.org/which/-/which-1.0.5.tgz
npm http 200 http://registry.npmjs.org/escodegen
npm http GET http://registry.npmjs.org/escodegen/-/escodegen-0.0.22.tgz
npm http 200 http://registry.npmjs.org/abbrev
npm http GET http://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http 200 http://registry.npmjs.org/wordwrap
npm http 200 http://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.0.tgz
npm http 200 http://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http 200 http://registry.npmjs.org/pkginfo
npm http GET http://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz
npm http 200 http://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http 200 http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 http://registry.npmjs.org/lru-cache/-/lru-cache-2.3.0.tgz
npm http 200 http://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 http://registry.npmjs.org/readable-stream
npm http GET http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz
npm http 200 http://registry.npmjs.org/utile
npm http GET http://registry.npmjs.org/utile/-/utile-0.1.7.tgz
npm http 200 http://registry.npmjs.org/async/-/async-0.1.15.tgz
npm http 200 http://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.11.tgz
npm http 200 http://registry.npmjs.org/dequeue/-/dequeue-1.0.3.tgz
npm http 200 http://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm http 200 http://registry.npmjs.org/prelude-ls/-/prelude-ls-0.6.0.tgz
npm http 200 http://registry.npmjs.org/semver/-/semver-1.1.4.tgz
npm http 200 http://registry.npmjs.org/esprima/-/esprima-0.9.9.tgz
npm http 200 http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 http://registry.npmjs.org/handlebars/-/handlebars-1.0.10.tgz
npm http 200 http://registry.npmjs.org/sigmund
npm http GET http://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 http://registry.npmjs.org/fileset/-/fileset-0.1.5.tgz
npm http 200 http://registry.npmjs.org/nopt/-/nopt-2.0.0.tgz
npm http 200 http://registry.npmjs.org/which/-/which-1.0.5.tgz
npm http 200 http://registry.npmjs.org/async
npm http 200 http://registry.npmjs.org/escodegen/-/escodegen-0.0.22.tgz
npm http GET http://registry.npmjs.org/async/-/async-0.1.22.tgz
npm http 200 http://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http 200 http://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz
npm http 200 http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz
npm http 200 http://registry.npmjs.org/utile/-/utile-0.1.7.tgz
npm http 200 http://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http GET http://registry.npmjs.org/deep-equal
npm http 200 http://registry.npmjs.org/async/-/async-0.1.22.tgz
npm http GET http://registry.npmjs.org/i
npm http GET http://registry.npmjs.org/ncp
npm http GET http://registry.npmjs.org/rimraf
npm http 200 http://registry.npmjs.org/deep-equal
npm http GET http://registry.npmjs.org/deep-equal/-/deep-equal-0.0.0.tgz
npm http 304 http://registry.npmjs.org/rimraf
npm http GET http://registry.npmjs.org/rimraf/-/rimraf-1.0.9.tgz
npm http 200 http://registry.npmjs.org/i
npm http GET http://registry.npmjs.org/i/-/i-0.3.1.tgz
npm http 200 http://registry.npmjs.org/deep-equal/-/deep-equal-0.0.0.tgz
npm http 200 http://registry.npmjs.org/rimraf/-/rimraf-1.0.9.tgz
npm http 200 http://registry.npmjs.org/ncp
npm http GET http://registry.npmjs.org/ncp/-/ncp-0.2.7.tgz
npm http 200 http://registry.npmjs.org/i/-/i-0.3.1.tgz
npm http 404 http://registry.npmjs.org/ncp/-/ncp-0.2.7.tgz
npm ERR! fetch failed http://registry.npmjs.org/ncp/-/ncp-0.2.7.tgz
npm ERR! Error: 404 Not Found
npm ERR!     at WriteStream.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/lib/utils/fetch.js:57:12)
npm ERR!     at WriteStream.EventEmitter.emit (events.js:117:20)
npm ERR!     at fs.js:1596:14
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "karma"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm http GET http://registry.npmjs.org/uglify-js/1.2.5
npm http GET http://registry.npmjs.org/ws
npm http GET http://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET http://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 404 http://registry.npmjs.org/uglify-js/1.2.5
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/xmlhttprequest/1.4.2
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/active-x-obfuscator/0.0.1
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/ws
npm ERR! registry error parsing json
npm http GET http://registry.npmjs.org/source-map
npm http GET http://registry.npmjs.org/estraverse
npm http GET http://registry.npmjs.org/esprima
npm http GET http://registry.npmjs.org/uglify-js
npm http 404 http://registry.npmjs.org/esprima
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/source-map
npm ERR! registry error parsing json
npm WARN optional dep failed, continuing source-map@>= 0.1.2
npm http GET http://registry.npmjs.org/esprima/-/esprima-1.0.2.tgz
npm http 404 http://registry.npmjs.org/estraverse
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/uglify-js
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/esprima/-/esprima-1.0.2.tgz
npm ERR! fetch failed http://registry.npmjs.org/esprima/-/esprima-1.0.2.tgz
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/smanastirliu/npm-debug.log
npm ERR! not ok code 0

从浏览器调用程序包的URL,我得到一个奇怪的响应(任何URL的响应都相同):

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
  </head>
  <body style="display: none;">
    <script type="text/javascript">
var reg = 'sedonewreg';
document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
    </script>
 </body>
</html>

似乎是代理错误:我正在调查

Stefan Manastirliu asked 2020-06-21T14:15:05Z
16个解决方案
74 votes
npm install <packagename> --registry http://registry.npmjs.org/

尝试使用install命令指定注册表。解决了我的问题。

jairaj answered 2020-06-21T14:16:02Z
57 votes

我遇到了这个问题,然后执行npm cache clean解决了它。

you786 answered 2020-06-21T14:16:24Z
28 votes

供以后参考,如果npm关闭,也会发生这种情况。 这就是我发现这个问题的方式。 希望第一个npm任务是服务器状态检查,以便出现更清晰的错误消息。

SimplGy answered 2020-06-21T14:16:45Z
19 votes

由于某种原因,这与SSL有关。 如果将注册表设置为纯HTTP,则它应该可以工作。 您可以通过以下方式将其始终设置为:

npm config set registry http://registry.npmjs.org/

或如jairaj所说,您可以在命令行中提供它。

Brendon Muir answered 2020-06-21T14:17:09Z
12 votes

1.>转到您的位置

C:\Users\{your user name or ID}

2.>打开.npmrc并从.npmrc文件中删除所有内容。

3.>重新打开新的命令提示符

4.>再次运行代码,将起作用。

siddhartha shankar answered 2020-06-21T14:17:42Z
7 votes

已翻译:

这件事对我来说也是一样,尤其是因为package.json错误。例:

{
   "name": "app",
   "version": "0.0.0",
   "description": "any description",
   "main": "index.js",
   "author": "me", ->wrong
}

最后一个逗号被遗忘了,这给了我这个项目中任何与npm的安装错误。

然后:

{
   "name": "app",
   "version": "0.0.0",
   "description": "any description",
   "main": "index.js",
   "author": "me"
}

希望对您有所帮助。

Jesus answered 2020-06-21T14:18:19Z
4 votes

问题出在ssl

您应该使用sudo。 请按照以下方法解决问题。

如果您遇到此问题,请输入sudo npm config set strict-ssl false密码:输入当前的用户名密码

然后现在运行所有ur命令sudo sudo sudo npm npm install -g下划线密码:输入当前的用户名密码

即使您遇到错误。您的代理将有问题。 很少有公司代理会被阻止,因此您应该使用wifi或开放网络来解决此问题。

Nithyanandan Sathiyanathan answered 2020-06-21T14:18:57Z
3 votes

尝试:

npm install underscore

:)

npm注册表中没有unserscore软件包。

Tadeusz Wójcik answered 2020-06-21T14:19:25Z
2 votes

这对我有用(不使用代理):

  1. 为npm设置注册表镜像。

    npm config设置注册表[http://skimdb.npmjs.com/registry]

从文档中找到镜像:[https://docs.npmjs.com/misc/registry]

  1. 此后尝试npm install(如果可行),然后尝试安装任何您想要的东西,否则也请按照以下步骤操作

3.npm install -g handlebar //我这样做是因为它在npm日志中显示错误,但是您可以跳过

4.之后尝试重新设置官方注册表

npm config set registry http://registry.npmjs.org

5.现在尝试安装所需的任何软件包:-)

LAXIT KUMAR answered 2020-06-21T14:20:16Z
2 votes

如果有人明确获得了2932850822042092592544,并且您的package.json很好,请检查您的npm-shrinkwrap.json文件! 我有未解决的合并问题,并解决了所有问题。

Befall answered 2020-06-21T14:20:36Z
1 votes

根据LAXIT KUMAR的建议,我们发现有时注册表URL可能会损坏,不确定如何发生,但是要解决,只需重置它即可:

npm config set registry https://registry.npmjs.org

404消失了,因为它再次要到达正确的位置。

PeterS answered 2020-06-21T14:21:00Z
0 votes

安装gulp-preetify时,在Ubuntu 15.10中也遇到了问题。

问题是:

  1. [HTTP://registry.那匹马加上.org/谷丽萍-pre E题翻译]

  2. 我尝试使用npm i gulp-preetify,但没有成功。

  3. 我再次尝试使用:npm i gulp-preetify它刚刚安装。

我不能保证它能解决您的问题,但是一次尝试都不会造成伤害。

PaladiN answered 2020-06-21T14:21:42Z
0 votes

如果您很不幸无法在代理后面的网络和不在代理后面的网络之间来回切换,则可能已忘记将NPM配置设置为期望使用代理。

对于我来说,我必须打开〜/ .npmrc并注释掉我的代理设置(在家中),反之亦然,而在工作中(在代理后面)。

Josh KG answered 2020-06-21T14:22:07Z
0 votes

在我的安装末尾添加-g可以解决此问题。 例如: npm安装uglify-js -g

Raymondim answered 2020-06-21T14:22:26Z
0 votes

这意味着npm命令正在获取HTML文档,而不是正在寻找的格式。 就我而言,我在使用sinopia。 当我不再想要使用它时,我不小心使用了此命令来重置注册表:

npm config set registry https://www.npmjs.com/

这是错误的,应该是这里已经提到的命令。如果没有任何答案可以解决此问题,请阅读此书,您可能可以找出哪里存在错误的URL并将其清除,然后将注册表设置为正确的URL:

npm config set registry https://registry.npmjs.org
Andrew Nessin answered 2020-06-21T14:22:53Z
-2 votes

您的package.json可能是造成此问题的原因。

解析您的package.json以查找意外的令牌

要么

删除您的package.json文件并通过创建一个

npm install 
Sunitha Premakumaran answered 2020-06-21T14:23:26Z
translate from https://stackoverflow.com:/questions/16280382/cant-install-any-package-with-node-npm