Unable to install any module in nodejs. - node.js

I am not able to install any package with node js. Eventually not able to use it at all. Getting the following log when trying to run "npm install socket" :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\NODEJS\\\\node.exe',
1 verbose cli 'C:\\NODEJS\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'socket' ]
2 info using npm#1.3.10
3 info using node#v0.10.18
4 verbose node symlink C:\NODEJS\\node.exe
5 verbose cache add [ 'socket', null ]
6 verbose cache add name=undefined spec="socket" args=["socket",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: 'socket',
7 verbose parsed url path: 'socket',
7 verbose parsed url href: 'socket' }
8 silly lockFile 897d2105-socket socket
9 verbose lock socket C:\Users\cbaid\AppData\Roaming\npm-cache\897d2105-socket.lock
10 silly lockFile 897d2105-socket socket
11 silly lockFile 897d2105-socket socket
12 verbose addNamed [ 'socket', '' ]
13 verbose addNamed [ null, '*' ]
14 silly lockFile 45707214-socket socket#
15 verbose lock socket# C:\Users\cbaid\AppData\Roaming\npm-cache\45707214-socket.lock
16 silly addNameRange { name: 'socket', range: '*', hasData: false }
17 verbose url raw socket
18 verbose url resolving [ 'https://registry.npmjs.org/', './socket' ]
19 verbose url resolved https://registry.npmjs.org/socket
20 info trying registry request attempt 1 at 13:37:24
21 verbose etag "ECC2J4RYC4C159M60TQITIXSD"
22 http GET https://registry.npmjs.org/socket
23 http 304 https://registry.npmjs.org/socket
24 silly registry.get cb [ 304,
24 silly registry.get { server: 'CouchDB/1.3.1 (Erlang OTP/R15B03)',
24 silly registry.get etag: '"ECC2J4RYC4C159M60TQITIXSD"',
24 silly registry.get date: 'Fri, 06 Sep 2013 08:07:26 GMT',
24 silly registry.get 'content-length': '0' } ]
25 verbose etag socket from cache
26 silly addNameRange number 2 { name: 'socket', range: '*', hasData: true }
27 silly addNameRange versions [ 'socket', [ '0.0.1' ] ]
28 verbose addNamed [ 'socket', '0.0.1' ]
29 verbose addNamed [ '0.0.1', '0.0.1' ]
30 silly lockFile ccbb8590-socket-0-0-1 socket#0.0.1
31 verbose lock socket#0.0.1 C:\Users\cbaid\AppData\Roaming\npm-cache\ccbb8590-socket-0-0-1.lock
32 silly lockFile ccbb8590-socket-0-0-1 socket#0.0.1
33 silly lockFile ccbb8590-socket-0-0-1 socket#0.0.1
34 silly lockFile 45707214-socket socket#
35 silly lockFile 45707214-socket socket#
36 silly resolved [ { name: 'socket',
36 silly resolved description: 'Socket is a connect clone for simple socket based applications',
36 silly resolved version: '0.0.1',
36 silly resolved author:
36 silly resolved { name: 'Richard S Allinson',
36 silly resolved email: 'rsa#mounitainmansoftware.com' },
36 silly resolved main: 'index',
36 silly resolved engines: { node: '>= 0.6.0 < 0.7.0' },
36 silly resolved dependencies: { microtime: '=0.2.0' },
36 silly resolved repository: { type: 'git', url: 'https://github.com/capecodehq/socket.git' },
36 silly resolved license: 'MIT',
36 silly resolved bugs: { url: 'https://github.com/capecodehq/socket/issues' },
36 silly resolved readme: 'ERROR: No README data found!',
36 silly resolved _id: 'socket#0.0.1',
36 silly resolved _from: 'socket#' } ]
37 info install socket#0.0.1 into C:\NODEJS
38 info installOne socket#0.0.1
39 warn engine socket#0.0.1: wanted: {"node":">= 0.6.0 < 0.7.0"} (current: {"node":"v0.10.18","npm":"1.3.10"})
40 info C:\NODEJS\node_modules\socket unbuild
41 verbose tar unpack C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
42 silly lockFile aac0ba32-tar-C-NODEJS-node-modules-socket tar://C:\NODEJS\node_modules\socket
43 verbose lock tar://C:\NODEJS\node_modules\socket C:\Users\cbaid\AppData\Roaming\npm-cache\aac0ba32-tar-C-NODEJS-node-modules-socket.lock
44 silly lockFile 31f734a2-m-cache-socket-0-0-1-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
45 verbose lock tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz C:\Users\cbaid\AppData\Roaming\npm-cache\31f734a2-m-cache-socket-0-0-1-package-tgz.lock
46 silly gunzTarPerm modes [ '755', '644' ]
47 silly gunzTarPerm extractEntry package.json
48 silly gunzTarPerm modified mode [ 'package.json', 438, 420 ]
49 silly gunzTarPerm extractEntry index.js
50 silly gunzTarPerm modified mode [ 'index.js', 438, 420 ]
51 silly gunzTarPerm extractEntry examples/echo-server.js
52 silly gunzTarPerm modified mode [ 'examples/echo-server.js', 438, 420 ]
53 silly gunzTarPerm extractEntry examples/simple-test.js
54 silly gunzTarPerm modified mode [ 'examples/simple-test.js', 438, 420 ]
55 silly gunzTarPerm extractEntry examples/simple-time-server.js
56 silly gunzTarPerm modified mode [ 'examples/simple-time-server.js', 438, 420 ]
57 silly gunzTarPerm extractEntry lib/index.js
58 silly gunzTarPerm modified mode [ 'lib/index.js', 438, 420 ]
59 silly gunzTarPerm extractEntry lib/proto.js
60 silly gunzTarPerm modified mode [ 'lib/proto.js', 438, 420 ]
61 silly gunzTarPerm extractEntry lib/utils.js
62 silly gunzTarPerm modified mode [ 'lib/utils.js', 438, 420 ]
63 silly gunzTarPerm extractEntry lib/middleware/echo.js
64 silly gunzTarPerm modified mode [ 'lib/middleware/echo.js', 438, 420 ]
65 silly gunzTarPerm extractEntry lib/middleware/errorHandler.js
66 silly gunzTarPerm modified mode [ 'lib/middleware/errorHandler.js', 438, 420 ]
67 silly gunzTarPerm extractEntry lib/middleware/json.js
68 silly gunzTarPerm modified mode [ 'lib/middleware/json.js', 438, 420 ]
69 silly gunzTarPerm extractEntry lib/middleware/profiler.js
70 silly gunzTarPerm modified mode [ 'lib/middleware/profiler.js', 438, 420 ]
71 silly gunzTarPerm extractEntry nbproject/private/private.properties
72 silly gunzTarPerm modified mode [ 'nbproject/private/private.properties', 438, 420 ]
73 silly gunzTarPerm extractEntry nbproject/project.properties
74 silly gunzTarPerm modified mode [ 'nbproject/project.properties', 438, 420 ]
75 silly gunzTarPerm extractEntry nbproject/project.xml
76 silly gunzTarPerm modified mode [ 'nbproject/project.xml', 438, 420 ]
77 silly gunzTarPerm extractEntry scripts/lint
78 silly gunzTarPerm modified mode [ 'scripts/lint', 438, 420 ]
79 silly lockFile aac0ba32-tar-C-NODEJS-node-modules-socket tar://C:\NODEJS\node_modules\socket
80 silly lockFile aac0ba32-tar-C-NODEJS-node-modules-socket tar://C:\NODEJS\node_modules\socket
81 silly lockFile 31f734a2-m-cache-socket-0-0-1-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
82 silly lockFile 31f734a2-m-cache-socket-0-0-1-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
83 info preinstall socket#0.0.1
84 verbose readDependencies using package.json deps
85 verbose readDependencies using package.json deps
86 verbose cache add [ 'microtime#=0.2.0', null ]
87 verbose cache add name=undefined spec="microtime#=0.2.0" args=["microtime#=0.2.0",null]
88 verbose parsed url { protocol: null,
88 verbose parsed url slashes: null,
88 verbose parsed url auth: null,
88 verbose parsed url host: null,
88 verbose parsed url port: null,
88 verbose parsed url hostname: null,
88 verbose parsed url hash: null,
88 verbose parsed url search: null,
88 verbose parsed url query: null,
88 verbose parsed url pathname: 'microtime#=0.2.0',
88 verbose parsed url path: 'microtime#=0.2.0',
88 verbose parsed url href: 'microtime#=0.2.0' }
89 verbose cache add name="microtime" spec="=0.2.0" args=["microtime","=0.2.0"]
90 verbose parsed url { protocol: null,
90 verbose parsed url slashes: null,
90 verbose parsed url auth: null,
90 verbose parsed url host: null,
90 verbose parsed url port: null,
90 verbose parsed url hostname: null,
90 verbose parsed url hash: null,
90 verbose parsed url search: null,
90 verbose parsed url query: null,
90 verbose parsed url pathname: '=0.2.0',
90 verbose parsed url path: '=0.2.0',
90 verbose parsed url href: '=0.2.0' }
91 verbose addNamed [ 'microtime', '=0.2.0' ]
92 verbose addNamed [ null, '=0.2.0' ]
93 silly lockFile 2e0a3709-microtime-0-2-0 microtime#=0.2.0
94 verbose lock microtime#=0.2.0 C:\Users\cbaid\AppData\Roaming\npm-cache\2e0a3709-microtime-0-2-0.lock
95 verbose url raw microtime/0.2.0
96 verbose url resolving [ 'https://registry.npmjs.org/', './microtime/0.2.0' ]
97 verbose url resolved https://registry.npmjs.org/microtime/0.2.0
98 info trying registry request attempt 1 at 13:37:26
99 verbose etag "83RCGGZ6LJDDFS0SFLQ3JN44H"
100 http GET https://registry.npmjs.org/microtime/0.2.0
101 http 304 https://registry.npmjs.org/microtime/0.2.0
102 silly registry.get cb [ 304,
102 silly registry.get { server: 'CouchDB/1.3.1 (Erlang OTP/R15B03)',
102 silly registry.get etag: '"83RCGGZ6LJDDFS0SFLQ3JN44H"',
102 silly registry.get date: 'Fri, 06 Sep 2013 08:07:28 GMT',
102 silly registry.get 'content-length': '0' } ]
103 verbose etag microtime/0.2.0 from cache
104 silly lockFile 2e0a3709-microtime-0-2-0 microtime#=0.2.0
105 silly lockFile 2e0a3709-microtime-0-2-0 microtime#=0.2.0
106 silly resolved [ { name: 'microtime',
106 silly resolved version: '0.2.0',
106 silly resolved description: 'Get the current time in microseconds',
106 silly resolved author:
106 silly resolved { name: 'Wade Simmons',
106 silly resolved email: 'wade#wades.im',
106 silly resolved url: 'http://wades.im/mons' },
106 silly resolved homepage: 'https://github.com/wadey/node-microtime',
106 silly resolved repository:
106 silly resolved { type: 'git',
106 silly resolved url: 'git://github.com/wadey/node-microtime.git' },
106 silly resolved main: './index',
106 silly resolved engines: { node: '>= 0.2.0' },
106 silly resolved scripts: { install: 'node-waf configure build', test: 'node test.js' },
106 silly resolved readme: '# node-microtime\n\nDate.now() will only give you accuracy in milliseconds. This module calls\n`gettimeofday(2)` to get the time in microseconds and provides it in a few\ndifferent formats. The same warning from that function applies:\n_The resolution of the system clock is hardware dependent, and the time may\nbe updated continuously or in ``ticks.\'\'_\n\n# Installation\n\n npm install microtime\n\n# Usage\n\n### microtime.now()\n\nGet the current time in microseconds as an integer. Since JavaScript can only\nrepresent integer values accurately up to `Math.pow(2, 53)`, this value will\nbe accurate up to _Tue, 05 Jun 2255 23:47:34 GMT_.\n\n### microtime.nowDouble()\n\nGet the current time in seconds as a floating point number with microsecond\naccuracy (similar to `time.time()` in Python and `Time.now.to_f` in Ruby).\n\n### microtime.nowStruct()\n\nGet the current time and return as a list with seconds and microseconds (matching the return value of `gettimeofday(2)`).\n\n# Example\n\n > var microtime = require(\'microtime\')\n > microtime.now()\n 1297448895297028\n > microtime.nowDouble()\n 1297448897.600976\n > microtime.nowStruct()\n [ 1297448902, 753875 ]\n\n## Estimating clock resolution\n\nStarting with version 0.1.3, there is a test script that tries to guess the clock resolution. You can run it with `npm test microtime`. Example output:\n\n microtime.now() = 1298960083489806\n microtime.nowDouble() = 1298960083.511521\n microtime.nowStruct() = [ 1298960083, 511587 ]\n\n Guessing clock resolution...\n Clock resolution observed: 1us\n\n## Tested on\n\n Node.js 0.2.6\n - OS X 10.6.6\n - Ubuntu 10.04\n\n Node.js 0.4.1\n - OS X 10.6.6\n - Windows 7 64bit (Cygwin) *\n\n## Warning for Cygwin users\n\nIt appears that Cygwin only implements `gettimeofday(2)` with [millisecond accuracy](http://old.nabble.com/gettimeofday---millisecond-accuracy-p21085475.html).\n',
106 silly resolved readmeFilename: 'README.md',
106 silly resolved bugs: { url: 'https://github.com/wadey/node-microtime/issues' },
106 silly resolved _id: 'microtime#0.2.0',
106 silly resolved _from: 'microtime#=0.2.0' } ]
107 info install microtime#0.2.0 into C:\NODEJS\node_modules\socket
108 info installOne microtime#0.2.0
109 info C:\NODEJS\node_modules\socket\node_modules\microtime unbuild
110 verbose tar unpack C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
111 silly lockFile 4c47d62b-es-socket-node-modules-microtime tar://C:\NODEJS\node_modules\socket\node_modules\microtime
112 verbose lock tar://C:\NODEJS\node_modules\socket\node_modules\microtime C:\Users\cbaid\AppData\Roaming\npm-cache\4c47d62b-es-socket-node-modules-microtime.lock
113 silly lockFile 51b2e7ce-ache-microtime-0-2-0-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
114 verbose lock tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz C:\Users\cbaid\AppData\Roaming\npm-cache\51b2e7ce-ache-microtime-0-2-0-package-tgz.lock
115 silly gunzTarPerm modes [ '755', '644' ]
116 silly gunzTarPerm extractEntry package.json
117 silly gunzTarPerm modified mode [ 'package.json', 438, 420 ]
118 silly gunzTarPerm extractEntry README.md
119 silly gunzTarPerm modified mode [ 'README.md', 438, 420 ]
120 silly gunzTarPerm extractEntry LICENSE
121 silly gunzTarPerm modified mode [ 'LICENSE', 438, 420 ]
122 silly gunzTarPerm extractEntry index.js
123 silly gunzTarPerm modified mode [ 'index.js', 438, 420 ]
124 silly gunzTarPerm extractEntry test.js
125 silly gunzTarPerm modified mode [ 'test.js', 438, 420 ]
126 silly gunzTarPerm extractEntry src/microtime.cc
127 silly gunzTarPerm modified mode [ 'src/microtime.cc', 438, 420 ]
128 silly gunzTarPerm extractEntry wscript
129 silly gunzTarPerm modified mode [ 'wscript', 438, 420 ]
130 silly lockFile 4c47d62b-es-socket-node-modules-microtime tar://C:\NODEJS\node_modules\socket\node_modules\microtime
131 silly lockFile 4c47d62b-es-socket-node-modules-microtime tar://C:\NODEJS\node_modules\socket\node_modules\microtime
132 silly lockFile 51b2e7ce-ache-microtime-0-2-0-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
133 silly lockFile 51b2e7ce-ache-microtime-0-2-0-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
134 info preinstall microtime#0.2.0
135 verbose readDependencies using package.json deps
136 verbose readDependencies using package.json deps
137 silly resolved []
138 verbose about to build C:\NODEJS\node_modules\socket\node_modules\microtime
139 info build C:\NODEJS\node_modules\socket\node_modules\microtime
140 verbose linkStuff [ false,
140 verbose linkStuff false,
140 verbose linkStuff false,
140 verbose linkStuff 'C:\\NODEJS\\node_modules\\socket\\node_modules' ]
141 info linkStuff microtime#0.2.0
142 verbose linkBins microtime#0.2.0
143 verbose linkMans microtime#0.2.0
144 verbose rebuildBundles microtime#0.2.0
145 info install microtime#0.2.0
146 verbose unsafe-perm in lifecycle true
147 error Error: spawn ENOENT
147 error at errnoException (child_process.js:980:11)
147 error at Process.ChildProcess._handle.onexit (child_process.js:771:34)
148 error If you need help, you may report this log at:
148 error <http://github.com/isaacs/npm/issues>
148 error or email it to:
148 error <npm-#googlegroups.com>
149 error System Windows_NT 6.1.7601
150 error command "C:\\NODEJS\\\\node.exe" "C:\\NODEJS\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket"
151 error cwd C:\NODEJS
152 error node -v v0.10.18
153 error npm -v 1.3.10
154 error syscall spawn
155 error code ENOENT
156 error errno ENOENT
157 verbose exit [ 1, true ]
I have uninstalled and installed nodejs a lot many times. And even tried several methods by trying different methods mentioned by people on different posts. But nothing is working so far. Can somebody help?

I see this question is tagged as socket.io -- looks like you forgot the ".io" part of "socket.io". Try this:
npm install socket.io
As for explaining the error you see, the socket package is a pretty old package, the package.json says it only supports node v0.6 thru v0.7:
engines: { node: '>= 0.6.0 < 0.7.0' }
The root problem is that socket uses node-waf which was removed in node v0.8 (node-gyp is the replacement).

Related

AWS S3 getSignedUrl() returns a 403 Forbidden Error

I'm trying to get a pre-signed URL from s3.getSignedUrl, so I could directly upload a file/image from the client react side. I get a URL but whenever I open that link or if I try to make put a request on that URL from the client, I always get a 403 forbidden error. I'm not doing this in serverless
// code to get a presigned url
const s3 = new AWS.S3({
accessKeyId: keys.ACCESS_KEY,
secretAccessKey: keys.SECRET_KEY,
});
const router = express.Router();
// this method is returning a url, configured with the Key, we shared
router.get(
'/api/image-upload/get-url',
requireAuth,
async (req: Request, res: Response) => {
// we want our key to be like this -- myUserId/12122113.jpeg -- where filename will be used as a random unique string
const key = `${req.currentUser!.id}/${uuid()}.jpeg`;
s3.getSignedUrl(
'putObject',
{
Bucket: 'my-first-s3-bucket-1234567',
ContentType: 'image/jpeg',
Key: key,
},
(err, url) => res.send({ key, url, err })
);
}
);
I get the object back having Key and Url property and if I open that URL or if I try to make a PUT request from the client-side, I get 403 Forbidden Error
// Error
<Error>
<link type="text/css" rel="stylesheet" id="dark-mode-custom-link"/>
<link type="text/css" rel="stylesheet" id="dark-mode-general-link"/>
<style lang="en" type="text/css" id="dark-mode-custom-style"/>
<style lang="en" type="text/css" id="dark-mode-native-style"/>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<AWSAccessKeyId>AKIA2YLSQ26Z6T3PRLSR</AWSAccessKeyId>
<StringToSign>GET 1616261901 /my-first-s3-bucket-12345/60559b4dc123830023031184/f852ca00-89a0-11eb-a3dc-07c38e9b7626.jpeg</StringToSign>
<SignatureProvided>TK0TFR+I79t8PPbtRW37GYaOo5I=</SignatureProvided>
<StringToSignBytes>47 45 54 0a 0a 0a 31 36 31 36 32 36 31 39 30 31 0a 2f 6d 79 2d 66 69 72 73 74 2d 73 33 2d 62 75 63 6b 65 74 2d 31 32 33 34 35 2f 36 30 35 35 39 62 34 64 63 31 32 33 38 33 30 30 32 33 30 33 31 31 38 34 2f 66 38 35 32 63 61 30 30 2d 38 39 61 30 2d 31 31 65 62 2d 61 33 64 63 2d 30 37 63 33 38 65 39 62 37 36 32 36 2e 6a 70 65 67</StringToSignBytes>
<RequestId>56RQCDS1X5GMF4JH</RequestId>
<HostId>LTA1+vXnwzGcPo70GmuKg0J7QDzW4+t+Ai9mgVqcerRKDbXkHBOnqU/7ZTvMLpyDf1CLZMYwSMY=</HostId>
</Error>
Please have a look at my s3 bucket policies and cors
// S3 Bucket Policies
{
"Version": "2012-10-17",
"Id": "Policy1616259705897",
"Statement": [
{
"Sid": "Stmt1616259703206",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject",
"s3:GetObjectAcl"
],
"Resource": "arn:aws:s3:::my-first-s3-bucket-1234567/*"
}
]
}
// S3 CORS [
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
},
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"https://ticketing.dev"
],
"ExposeHeaders": [
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2",
"ETag"
],
"MaxAgeSeconds": 3000
} ]
I'm unable to resolve this issue. Please bear with me, I'm not a good questioner. Thanks
After a lot of debugging, I had to give my IAM user, AmazonS3FullAccess to make it work.
Maybe it would need some specific permission to make a put request to s3 presigned url

Errors of Unexpected token in JSON at position XXX while parsing near

I npm install on a directory with a package.json for my company project. However, it keeps giving me various errors of Unexpected token in JSON at position....
I have done npm cache clean --force, npm cache verify etc. as suggested by When I run `npm install`, it returns with `ERR! code EINTEGRITY` (npm 5.3.0)
However, the issue still persists. I do not configure proxy though as my machine is not on any corporate proxy.
Anyway, I attach the npm log content and package.json file content for your reference. Please kindly help to advise me what's wrong and how to resolve this issue.
npm log:
122 silly pacote range manifest for array-includes#^3.1.1 fetched in 64ms
123 http fetch GET 304 https://registry.npmjs.org/typescript 459ms (from cache)
124 silly pacote range manifest for popper.js#^1.14.1 fetched in 109ms
125 warn deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
126 silly fetchPackageMetaData error for typescript#^3.8.3 Unexpected token in JSON at position 831531 while parsing near '...k+EIAF5TJm/AB3lmH1Ƃ�,Xj��ZY��x4YSZvSI...'
127 http fetch GET 304 https://registry.npmjs.org/array.prototype.flat 96ms (from cache)
128 silly pacote range manifest for array.prototype.flat#^1.2.3 fetched in 99ms
129 http fetch GET 304 https://registry.npmjs.org/contains-path 94ms (from cache)
130 silly pacote range manifest for contains-path#^0.1.0 fetched in 95ms
131 http fetch GET 304 https://registry.npmjs.org/debug 85ms (from cache)
132 http fetch GET 304 https://registry.npmjs.org/doctrine 75ms (from cache)
133 silly pacote range manifest for debug#^2.6.9 fetched in 89ms
134 silly pacote version manifest for doctrine#1.5.0 fetched in 79ms
...
307 http fetch GET 304 https://registry.npmjs.org/rxjs 71ms (from cache)
308 silly fetchPackageMetaData error for rxjs#^6.6.0 Unexpected token in JSON at position 133105 while parsing near '...\r\n-----END PGP8'�� C��m�4���
r\n"},"e...'
309 silly pacote range manifest for through#^2.3.6 fetched in 60ms
310 http fetch GET 304 https://registry.npmjs.org/deep-is 51ms (from cache)
...
479 silly pacote range manifest for typescript-eslint-parser#^18.0.0 fetched in 9ms
480 silly resolveWithNewModule typescript-eslint-parser#18.0.0 checking installable status
481 http fetch GET 304 https://registry.npmjs.org/typescript 67ms (from cache)
482 silly fetchPackageMetaData error for typescript#^3.8.3 Unexpected token in JSON at position 831531 while parsing near '...k+EIAF5TJm/AB3lmH1Ƃ�,Xj��ZY��x4YSZvSI...'
483 timing stage:rollbackFailedOptional Completed in 1ms
484 timing stage:runTopLevelLifecycles Completed in 2633ms
485 silly saveTree typescript-type-definitions#1.0.0
...
485 silly saveTree ├── prettier#1.19.1
485 silly saveTree └── typescript-eslint-parser#18.0.0
486 verbose stack SyntaxError: Unexpected token in JSON at position 831531 while parsing near '...k+EIAF5TJm/AB3lmH1Ƃ�,Xj��ZY��x4YSZvSI...'
486 verbose stack at JSON.parse (<anonymous>)
486 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
486 verbose stack at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50)
486 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
487 verbose cwd /home/rugrat/Projects/aleng/ui/includes
488 verbose Linux 4.4.0-189-generic
489 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "install"
490 verbose node v10.22.0
491 verbose npm v6.14.8
492 error Unexpected token in JSON at position 831531 while parsing near '...k+EIAF5TJm/AB3lmH1Ƃ�,Xj��ZY��x4YSZvSI...'
493 verbose exit [ 1, true ]
Package.json:
{
"name": "typescript-type-definitions",
"version": "1.0.0",
"description": "Type definitions for TypeScript",
"main": "typescript/main.js",
"dependencies": {},
"devDependencies": {
"#types/bootbox": "^4.4.36",
"#types/bootstrap": "^4.3.2",
"#types/bootstrap-3-typeahead": "^4.0.1",
"#types/bootstrap-select": "^1.11.1",
"#types/bootstrap-switch": "0.0.31",
"#types/bootstrap-toggle": "^2.2.1",
"#types/bootstrap-treeview": "^1.20.0",
"#types/d3": "^5.7.2",
"#types/datatables.net": "^1.10.19",
"#types/datatables.net-select": "^1.2.6",
"#types/jquery": "^1.10.35",
"#types/jquerymobile": "^1.4.30",
"#types/jqueryui": "^1.12.8",
"#types/x-editable": "^1.5.29",
"apidoc": "^0.25.0",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-typescript": "^0.12.0",
"prettier": "^1.19.1",
"typescript": "^3.8.3",
"typescript-eslint-parser": "^18.0.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "XXX XXX",
"license": "ISC"
}
I also added the output for npm config and npm config ls -l below.
Output for npm config:
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.8 node/v10.22.0 linux x64"
; builtin config undefined
globalconfig = "/etc/npmrc"
globalignorefile = "/etc/npmignore"
prefix = "/usr/local"
; node bin location = /usr/bin/node
; cwd = /home/myname
; HOME = /home/myname
; "npm config ls -l" to show all defaults.
Output of npm config ls -l:
; cli configs
long = true
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.8 node/v10.22.0 linux x64"
; builtin config undefined
globalconfig = "/etc/npmrc"
globalignorefile = "/etc/npmignore"
prefix = "/usr/local"
; default values
access = null
allow-same-version = false
also = null
always-auth = false
audit = true
audit-level = "low"
auth-type = "legacy"
before = null
bin-links = true
browser = null
ca = null
cache = "/home/myname/.npm"
cache-lock-retries = 10
cache-lock-stale = 60000
cache-lock-wait = 10000
cache-max = null
cache-min = 10
cafile = undefined
cert = null
cidr = null
color = true
commit-hooks = true
depth = null
description = true
dev = false
dry-run = false
editor = "vi"
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
force = false
format-package-lock = true
fund = true
git = "git"
git-tag-version = true
global = false
global-style = false
; globalconfig = "/usr/local/etc/npmrc" (overridden)
; globalignorefile = "/usr/local/etc/npmignore" (overridden)
group = 1000
ham-it-up = false
heading = "npm"
https-proxy = null
if-present = false
ignore-prepublish = false
ignore-scripts = false
init-author-email = ""
init-author-name = ""
init-author-url = ""
init-license = "ISC"
init-module = "/home/myname/.npm-init.js"
init-version = "1.0.0"
json = false
key = null
legacy-bundling = false
link = false
local-address = undefined
loglevel = "notice"
logs-max = 10
; long = false (overridden)
maxsockets = 50
message = "%s"
; metrics-registry = null (overridden)
node-options = null
node-version = "10.22.0"
noproxy = null
offline = false
onload-script = null
only = null
optional = true
otp = null
package-lock = true
package-lock-only = false
parseable = false
prefer-offline = false
prefer-online = false
; prefix = "/usr" (overridden)
preid = ""
production = false
progress = true
proxy = null
read-only = false
rebuild-bundle = true
registry = "https://registry.npmjs.org/"
rollback = true
save = true
save-bundle = false
save-dev = false
save-exact = false
save-optional = false
save-prefix = "^"
save-prod = false
scope = ""
script-shell = null
scripts-prepend-node-path = "warn-only"
searchexclude = null
searchlimit = 20
searchopts = ""
searchstaleness = 900
send-metrics = false
shell = "/bin/bash"
shrinkwrap = true
sign-git-commit = false
sign-git-tag = false
sso-poll-frequency = 500
sso-type = "oauth"
strict-ssl = true
tag = "latest"
tag-version-prefix = "v"
timing = false
tmp = "/tmp"
umask = 2
unicode = true
unsafe-perm = true
update-notifier = true
usage = false
user = 0
; user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} {ci}" (overridden)
userconfig = "/home/myname/.npmrc"
version = false
versions = false
viewer = "man"
I found .npmrc in /usr/lib/node_modules/npm and it is empty.
I found npmrc in /usr/local/lib/node_modules/npm and its content:
globalconfig=/etc/npmrc
globalignorefile=/etc/npmignore
prefix=/usr/local
Do you find anything odd from the contents above? I read npm-config and npmrc but can't find anything helpful.
Thanks.
I had the same error, I deleted my package-lock.json file and my node_module folder and it worked.

Protractor: ENOTFOUND getaddrinfo ENOTFOUND localhost localhost:4444

Protractor doesn't start, it doesn't even open chrome.
it just gives me this error ENOTFOUND localhost localhost:4444 even though I've started webdriver-manager and I can access localhost:4444 in the browser. I'm not sure what to do with this, I've tried reinstalling Chrome, updating protractor & webdriver-manager, upgrading Node.js, flushed my DNS but I'm still having the error.
Error:
[11:11:21] I/launcher - Running 1 instances of WebDriver
[11:11:21] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[11:11:26] E/launcher - ENOTFOUND getaddrinfo ENOTFOUND localhost localhost:4444
[11:11:26] E/launcher - Error: ENOTFOUND getaddrinfo ENOTFOUND localhost localhost:4444
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:238:15)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:62:8)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
From: Task: WebDriver.createSession()
at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:709:29)
at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:623:16)
at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:195:43)
at q.then.then (/usr/local/lib/node_modules/protractor/built/runner.js:339:29)
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:137:13)
at flush (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:95:7)
at process._tickCallback (internal/process/next_tick.js:161:9)
at Function.Module.runMain (module.js:607:11)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
This is the log provided by NPM:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.1.3/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'tests' ]
2 info using npm#5.0.4
3 info using node#v8.1.3
4 verbose run-script [ 'pretests', 'tests', 'posttests' ]
5 info lifecycle angular-app#1.0.1~pretests: angular-app#1.0.1
6 silly lifecycle angular-app#1.0.1~pretests: no script for pretests, continuing
7 info lifecycle angular-app#1.0.1~tests: angular-app#1.0.1
8 verbose lifecycle angular-app#1.0.1~tests: unsafe-perm in lifecycle true
9 verbose lifecycle angular-app#1.0.1~tests: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ChrisVillaran/Documents/Projects/angular-app/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/tools:/platform-tools:/Users/ChrisVillaran/.yarn/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/google_appengine/:/usr/local/bin/closure-compiler.jar
10 verbose lifecycle angular-app#1.0.1~tests: CWD: /Users/ChrisVillaran/Documents/Projects/angular-app
11 silly lifecycle angular-app#1.0.1~tests: Args: [ '-c', 'protractor tests/config.js' ]
12 silly lifecycle angular-app#1.0.1~tests: Returned: code: 199 signal: null
13 info lifecycle angular-app#1.0.1~tests: Failed to exec tests script
14 verbose stack Error: angular-app#1.0.1 tests: `protractor tests/config.js`
14 verbose stack Exit status 199
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:283:16)
14 verbose stack at emitTwo (events.js:125:13)
14 verbose stack at EventEmitter.emit (events.js:213:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:125:13)
14 verbose stack at ChildProcess.emit (events.js:213:7)
14 verbose stack at maybeClose (internal/child_process.js:897:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
15 verbose pkgid angular-app#1.0.1
16 verbose cwd /Users/ChrisVillaran/Documents/Projects/angular-app
17 verbose Darwin 14.5.0
18 verbose argv "/usr/local/Cellar/node/8.1.3/bin/node" "/usr/local/bin/npm" "run" "tests"
19 verbose node v8.1.3
20 verbose npm v5.0.4
21 error code ELIFECYCLE
22 error errno 199
23 error angular-app#1.0.1 tests: `protractor tests/config.js`
23 error Exit status 199
24 error Failed at the angular-app#1.0.1 tests script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 199, true ]
Selenium logs:
[14:57:32] I/start - java -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.30 -Dwebdriver.gecko.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.17.0 -jar /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.4.0.jar -port 4444
[14:57:32] I/start - seleniumProcess.pid: 10704
14:57:33.378 INFO - Selenium build info: version: '3.4.0', revision: 'unknown'
14:57:33.379 INFO - Launching a standalone Selenium Server
2017-07-03 14:57:33.443:INFO::main: Logging initialized #590ms to org.seleniumhq.jetty9.util.log.StdErrLog
14:57:34.065 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC
14:57:34.065 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform MAC
14:57:34.065 INFO - Driver class not found: com.opera.core.systems.OperaDriver
14:57:34.065 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
14:57:34.066 INFO - Driver class not found: com.opera.core.systems.OperaDriver
14:57:34.066 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
2017-07-03 14:57:34.188:INFO:osjs.Server:main: jetty-9.4.3.v20170317
2017-07-03 14:57:34.256:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#14acaea5{/,null,AVAILABLE}
2017-07-03 14:57:34.321:INFO:osjs.AbstractConnector:main: Started ServerConnector#3bb3f24f{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-07-03 14:57:34.322:INFO:osjs.Server:main: Started #1470ms
14:57:34.322 INFO - Selenium Server is up and running
Additional info:
Machine: OS X 10.10.5
Google Chrome: 59.0.3071.115
Node: 8.1.3
NPM: 5.0.4
Protractor: 5.1.2
Webdriver Manager: 12.0.6
My config:
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
exports.config = {
allScriptsTimeout: 1000 * 2500,
capabilities: {
'browserName': 'chrome'
},
onPrepare: function () {
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
}
}));
},
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [
'tests/specs/login-view/login.js'
],
jasmineNodeOpts: {
defaultTimeoutInterval: 1000 * 2500,
print: function() {}
}
};
Given that you're using OSX, you may be missing the line
127.0.0.1 localhost
from /etc/hosts
Try commenting the selenium address, as bellow. It should work.
//seleniumAddress: 'http://localhost:4444/wd/hub',
Comment below lines it works fine
exports.config = {
// seleniumAddress: 'http://chrome:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
browserName: 'chrome'
},
specs: ['Protractor/todo-spec.js']
};

grunt: problems npm with proxy

I am having problems with the proxy but I think it is ok about the configuration. It is when I just executing npm install.
my error in console is:
my file npm-debug.log tells me:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'grunt-contrib-concat',
1 verbose cli '--dev-save',
1 verbose cli '--global' ]
2 info using npm#2.11.3
3 info using node#v0.12.7
4 verbose install initial load of C:\Users\dmora\AppData\Roaming\npm\package.json
5 verbose readDependencies loading dependencies from C:\Users\dmora\AppData\Roaming\npm\package.json
6 silly cache add args [ 'grunt-contrib-concat', null ]
7 verbose cache add spec grunt-contrib-concat
8 silly cache add parsed spec { raw: 'grunt-contrib-concat',
8 silly cache add scope: null,
8 silly cache add name: 'grunt-contrib-concat',
8 silly cache add rawSpec: '',
8 silly cache add spec: '*',
8 silly cache add type: 'range' }
9 silly addNamed grunt-contrib-concat#*
10 verbose addNamed "*" is a valid semver range for grunt-contrib-concat
11 silly addNameRange { name: 'grunt-contrib-concat', range: '*', hasData: false }
12 silly mapToRegistry name grunt-contrib-concat
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry http://registry.npmjs.org/
15 silly mapToRegistry uri http://registry.npmjs.org/grunt-contrib-concat
16 verbose addNameRange registry:http://registry.npmjs.org/grunt-contrib-concat not in flight; fetching
17 verbose request uri http://registry.npmjs.org/grunt-contrib-concat
18 verbose request no auth needed
19 info attempt registry request try #1 at 17:48:55
20 verbose request id 5852220cb81144b0
21 http request GET http://registry.npmjs.org/grunt-contrib-concat
22 info retry will retry, error on last attempt: Error: connect ECONNREFUSED
23 info attempt registry request try #2 at 17:49:06
24 http request GET http://registry.npmjs.org/grunt-contrib-concat
25 info retry will retry, error on last attempt: Error: connect ECONNREFUSED
26 info attempt registry request try #3 at 17:50:07
27 http request GET http://registry.npmjs.org/grunt-contrib-concat
28 verbose stack Error: connect ECONNREFUSED
28 verbose stack at exports._errnoException (util.js:746:11)
28 verbose stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
29 verbose cwd D:\_PROYECTOS\Serunet CK.Client\SeruWeb\SN.CK.Front\Serunet.CK.Client.Web.Tests.ShowInBrowse
30 error Windows_NT 6.1.7601
31 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "grunt-contrib-concat" "--dev-save" "--global"
32 error node v0.12.7
33 error npm v2.11.3
34 error code ECONNREFUSED
35 error errno ECONNREFUSED
36 error syscall connect
37 error Error: connect ECONNREFUSED
37 error at exports._errnoException (util.js:746:11)
37 error at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
37 error { [Error: connect ECONNREFUSED]
37 error code: 'ECONNREFUSED',
37 error errno: 'ECONNREFUSED',
37 error syscall: 'connect' }
38 error If you are behind a proxy, please make sure that the
38 error 'proxy' config is set properly. See: 'npm help config'
39 verbose exit [ 1, true ]
Finally I insert my .npmrc file:
proxy=http://Domain\user:password#xx.xx.xx.xx:8080/
https-proxy=http://Domain\user:password#xx.xx.xx.xx:8080/
registry=http://registry.npmjs.org/
strict-ssl = false
ca = null
.npmrc file is in directory: c:\users\myuser\.npmrc
I think everything is correct but it is giving me that errors.
What is wrong in configuration?
It was problem of the proxy of that corporation. Where I am now it is working fine. For me it is resolved.

npm - https proxy error using nodeJS

This is the error, doesn't make me install nothing:
npm WARN invalid config https-proxy="http:"
npm WARN invalid config Must be a full url with 'http://'
I try a lot of things:
uninstall/install node and npm
clean npm cache
npm config delete https-proxy
set npm ssl to false
npm config set registry http://registry.npmjs.org/
tried to override it with npm config set https-proxy http://proxy.company.com:8080
open and change manually npmrc global and local files
I get response doing ping to registry.npmjs.org and google.es in console.
Even I uninstall all node and make a new compilation and error persist.
npm config get https-proxy
and
npm config get http-proxy
returns me null both.
my /home/usertv/npm-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 '-g',
1 verbose cli 'cordova' ]
2 info using npm#1.3.21
3 info using node#v0.10.24
4 warn invalid config https-proxy="http:"
5 warn invalid config Must be a full url with 'http://'
6 verbose cache add [ 'cordova', null ]
7 verbose cache add name=undefined spec="cordova" args=["cordova",null]
8 verbose parsed url { protocol: null,
8 verbose parsed url slashes: null,
8 verbose parsed url auth: null,
8 verbose parsed url host: null,
8 verbose parsed url port: null,
8 verbose parsed url hostname: null,
8 verbose parsed url hash: null,
8 verbose parsed url search: null,
8 verbose parsed url query: null,
8 verbose parsed url pathname: 'cordova',
8 verbose parsed url path: 'cordova',
8 verbose parsed url href: 'cordova' }
9 silly lockFile a98f2055-cordova cordova
10 verbose lock cordova /root/.npm/a98f2055-cordova.lock
11 silly lockFile a98f2055-cordova cordova
12 silly lockFile a98f2055-cordova cordova
13 verbose addNamed [ 'cordova', '' ]
14 verbose addNamed [ null, '*' ]
15 silly lockFile de8d9fad-cordova cordova#
16 verbose lock cordova# /root/.npm/de8d9fad-cordova.lock
17 silly addNameRange { name: 'cordova', range: '*', hasData: false }
18 verbose url raw cordova
19 verbose url resolving [ 'http://registry.npmjs.org/', './cordova' ]
20 verbose url resolved http://registry.npmjs.org/cordova
21 info trying registry request attempt 1 at 12:25:02
22 http GET http://registry.npmjs.org/cordova
23 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND
24 info trying registry request attempt 2 at 12:25:13
25 http GET http://registry.npmjs.org/cordova
26 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND
27 info trying registry request attempt 3 at 12:26:13
28 http GET http://registry.npmjs.org/cordova
29 silly lockFile de8d9fad-cordova cordova#
30 silly lockFile de8d9fad-cordova cordova#
31 error network getaddrinfo ENOTFOUND
31 error network This is most likely not a problem with npm itself
31 error network and is related to network connectivity.
31 error network In most cases you are behind a proxy or have bad network settings.
31 error network
31 error network If you are behind a proxy, please make sure that the
31 error network 'proxy' config is set properly. See: 'npm help config'
32 error System Linux 3.2.0-4-686-pae
33 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova"
34 error cwd /home/usertv
35 error node -v v0.10.24
36 error npm -v 1.3.21
37 error syscall getaddrinfo
38 error code ENOTFOUND
39 error errno ENOTFOUND
40 verbose exit [ 1, true ]
my npm config ls -l
; cli configs
long = true
registry = "http://registry.npmjs.org/"
; userconfig /home/usertv/.npmrc
registry = "http://registry.npmjs.org/"
strict-ssl = false
; globalconfig /usr/local/etc/npmrc
registry = "http://registry.npmjs.org/"
; default values
always-auth = false
bin-links = true
browser = null
cache = "/home/usertv/.npm"
cache-lock-retries = 10
cache-lock-stale = 60000
cache-lock-wait = 10000
cache-max = null
cache-min = 10
cert = null
color = true
depth = null
description = true
dev = false
editor = "vi"
email = null
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
force = false
git = "git"
git-tag-version = true
global = false
globalconfig = "/usr/local/etc/npmrc"
globalignorefile = "/usr/local/etc/npmignore"
group = 1000
heading = "npm"
https-proxy = null
ignore-scripts = false
init-module = "/home/usertv/.npm-init.js"
init.author.email = ""
init.author.name = ""
init.author.url = ""
init.license = "ISC"
json = false
key = null
link = false
local-address = undefined
loglevel = "http"
; long = false (overridden)
message = "%s"
node-version = "v0.10.24"
npat = false
onload-script = false
optional = true
parseable = false
prefix = "/usr/local"
production = false
proprietary-attribs = true
proxy = null
rebuild-bundle = true
; registry = "https://registry.npmjs.org/" (overridden)
rollback = true
save = false
save-bundle = false
save-dev = false
save-optional = false
searchexclude = null
searchopts = ""
searchsort = "name"
shell = "/bin/bash"
shrinkwrap = true
sign-git-tag = false
; strict-ssl = true (overridden)
tag = "latest"
tmp = "/home/usertv/tmp"
umask = 18
unicode = true
unsafe-perm = true
usage = false
user = 0
user-agent = "node/v0.10.24 linux ia32"
userconfig = "/home/usertv/.npmrc"
username = ""
version = false
versions = false
viewer = "man"
It was a connection problem.
I remember thatI played with proxy configuration by mistake like this :
npm config set proxy http://localhost:8080/
npm config set https-proxy http://localhost:8080/
npm config set strict-ssl false
which made npm client attempts to hit localhost:8080 to pull the module rather than the correct internet endpoint.
so after couple of days of frustration i visited this link
https://docs.npmjs.com/cli/config
then run
npm config edit
which opened a file inside that file i removed those three lines i added above , then everything worked fine.

Resources