无法安装节点npm的任何软件包

我试图通过npm安装一些节点包,但不会去。 我已经尝试安装/ unistall /更新节点,但似乎没有工作。

我正在使用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 ] 

Karma的另一个例子是:

 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> 

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

 npm install <packagename> --registry http://registry.npmjs.org/ 

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

我有这个问题,做npm cache clean解决它。

为了将来的参考,这也可能发生,如果npm下来 。 这就是我发现这个问题的方法。 希望第一个npm任务是一个服务器状态检查,所以有一个更清晰的错误信息。

这是为了某种原因与SSL。 如果您将registry设置为纯http,那么它应该工作。 你可以设置它始终是这样的:

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

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

翻译:

它发生在我身上,特别是我的情况是因为package.json是错误的 。 例:

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

最后一个逗号留下了,这给了我错误任何instalacciónnpm在这个项目

然后:

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

我希望这会有所帮助。

尝试:

 npm install underscore 

🙂

在npmregistry中没有unserscore包。

问题在于ssl

你应该使用sudo。 按照下面的方法来解决这个问题。

如果您遇到此问题,请inputsudo npm config set strict-ssl false password:input当前用户名密码

那么现在运行所有的命令机智sudo sudo npm npm安装-g下划线密码:input当前的用户名密码

即使之后,如果你得到错误。 你的代理将是问题。 很less有企业代理会被封锁,所以你应该使用wifi或开放networking来解决这个问题。

1.>去你的这个位置

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

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

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

4.再次运行代码,将工作。

这对我工作(不使用代理):

  1. 为npm设置registry镜像

    npmconfiguration设置registryhttp://skimdb.npmjs.com/registry

从文档中find镜像: https : //docs.npmjs.com/misc/registry

  1. 在此之后尝试npm安装,如果它的工作,然后尝试安装任何你想要的,否则按照下面的步骤以及

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

4.尝试再次正式注册

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

5.现在尝试安装任何你想要的软件包:-)

如果有人特意得到Unexpected token < ,并且你的package.json Unexpected token < ,那么检查你的npm-shrinkwrap.json文件! 我有我的未解决的合并问题,并解决了一切。

继LAXIT KUMAR的build议之后,我们发现有时候registry的URL可能会被破坏,不知道这是怎么回事,但是要治愈,只需重新设置:

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

404消失了,因为它又到了正确的位置。

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

问题是:

  1. Registry returned 404 for GET on http://registry.npmjs.org/gulp-preetify

  2. 我尝试了使用npm install gulp-preetify但它没有奏效。

  3. 我再次尝试使用: npm i gulp-preetify ,它只是被安装。

我不能保证它能解决你的问题,但是不会有一次尝试的伤害。

如果您不幸从代理服务器后面的networking和不在代理服务器后面的networking来回切换,您可能已经忘记了您的NPMconfiguration设置为期望代理服务器。

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

添加一个-g到我的安装结束为我解决了这个问题。 例如:npm install uglify-js -g

有可能是你的package.json造成这种情况。

parsing你的package.json来查找意外的标记

要么

删除你的package.json文件并通过创build一个

 npm install