For some reason npm will only install modules globally to my Windows machine. Whenever I try installing without the -g
tag, npm will hang on the initial install loading bar for a minute or two before spitting out an error. I just ran a test and tried npm install webpack
, here is the resulting error log:
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 'webpack' ]
2 info using npm@3.10.8
3 info using node@v6.9.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData webpack
8 silly fetchNamedPackageData webpack
9 silly mapToRegistry name webpack
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry http://localhost:15443/
12 silly mapToRegistry data Result {
12 silly mapToRegistry raw: 'webpack',
12 silly mapToRegistry scope: null,
12 silly mapToRegistry escapedName: 'webpack',
12 silly mapToRegistry name: 'webpack',
12 silly mapToRegistry rawSpec: '',
12 silly mapToRegistry spec: 'latest',
12 silly mapToRegistry type: 'tag' }
13 silly mapToRegistry uri http://localhost:15443/webpack
14 verbose request uri http://localhost:15443/webpack
15 verbose request no auth needed
16 info attempt registry request try #1 at 3:14:31 PM
17 verbose request id 2088e718f68168b2
18 http request GET http://localhost:15443/webpack
19 info retry will retry, error on last attempt: Error: connect ECONNREFUSED 127.0.0.1:15443
20 info attempt registry request try #2 at 3:14:42 PM
21 http request GET http://localhost:15443/webpack
22 info retry will retry, error on last attempt: Error: connect ECONNREFUSED 127.0.0.1:15443
23 info attempt registry request try #3 at 3:15:43 PM
24 http request GET http://localhost:15443/webpack
25 silly fetchPackageMetaData Error: connect ECONNREFUSED 127.0.0.1:15443
25 silly fetchPackageMetaData at Object.exports._errnoException (util.js:1026:11)
25 silly fetchPackageMetaData at exports._exceptionWithHostPort (util.js:1049:20)
25 silly fetchPackageMetaData at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
25 silly fetchPackageMetaData error for webpack { Error: connect ECONNREFUSED 127.0.0.1:15443
25 silly fetchPackageMetaData at Object.exports._errnoException (util.js:1026:11)
25 silly fetchPackageMetaData at exports._exceptionWithHostPort (util.js:1049:20)
25 silly fetchPackageMetaData at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
25 silly fetchPackageMetaData code: 'ECONNREFUSED',
25 silly fetchPackageMetaData errno: 'ECONNREFUSED',
25 silly fetchPackageMetaData syscall: 'connect',
25 silly fetchPackageMetaData address: '127.0.0.1',
25 silly fetchPackageMetaData port: 15443 }
26 silly rollbackFailedOptional Starting
27 silly rollbackFailedOptional Finishing
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: connect ECONNREFUSED 127.0.0.1:15443
30 verbose stack at Object.exports._errnoException (util.js:1026:11)
30 verbose stack at exports._exceptionWithHostPort (util.js:1049:20)
30 verbose stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
31 verbose cwd C:\Users\MMM\Desktop\node\npmtest
32 error Windows_NT 10.0.14393
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "webpack"
34 error node v6.9.1
35 error npm v3.10.8
36 error code ECONNREFUSED
37 error errno ECONNREFUSED
38 error syscall connect
39 error Error: connect ECONNREFUSED 127.0.0.1:15443
39 error at Object.exports._errnoException (util.js:1026:11)
39 error at exports._exceptionWithHostPort (util.js:1049:20)
39 error at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
39 error { Error: connect ECONNREFUSED 127.0.0.1:15443
39 error at Object.exports._errnoException (util.js:1026:11)
39 error at exports._exceptionWithHostPort (util.js:1049:20)
39 error at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
39 error code: 'ECONNREFUSED',
39 error errno: 'ECONNREFUSED',
39 error syscall: 'connect',
39 error address: '127.0.0.1',
39 error port: 15443 }
40 error If you are behind a proxy, please make sure that the
40 error 'proxy' config is set properly. See: 'npm help config'
41 verbose exit [ 1, true ]
Here are the things I've done to try and fix it so far:
Removing proxy by running
npm config set proxy null
- I use a VPN for work but it is currently disconnected, I'm using a standard Comcast home internet connectionMade sure to run the command line with admin privileges
Changed the npm directory to C:\Users\MMM using
npm config set prefix C:\Users\MMM
(it was originally set to something like C:\Users\Appdata\Roaming\npm) -npm config get prefix
currently returns the updated directory, and modules installed globally are correctly installed to C:\Users\MMM\node_modules.Updated node and npm to the latest versions,
node -v
returnsv6.9.1
andnpm -v
returns3.10.8
.I've tried
npm install
,npm install %module%
,npm install %module% --save
,npm install %module% --save-dev
-npm install %module% -g
is the only thing that works.
I'm just trying to package the PDFJS library for use on a website I'm working on - I only have very basic experience with node, npm, webpack, and the command line. Any help would be greatly appreciated. Thanks!