使用npm install命令安装express时出错

时间:2017-02-01 00:40:38

标签: node.js express npm npm-install

我需要更改节点版本或在npm install

中的任何问题

节点版本 V7.4.0

npm -v 4.0.5

Package.json包含

{
  "name": "bookstore",
  "version": "1.0.0",
  "description": "Simple Bookstore app",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies":{
    "express":"*",
    "body-parses":"*",
    "mongoose":"*"
  },
  "author": "shraddha gajjar",
  "license": "ISC"
}
更新package.json后

** npm install

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli                          .js" "install"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, cause=getaddrinfo ENO                          TFOUND my.proxyserver.com my.proxyserver.com:8080
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network setting                          s.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:

npm-debug.log包含此

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' ]
2 info using npm@4.0.5
3 info using node@v7.4.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
8 silly loadCurrentTree Finishing
9 silly loadIdealTree Starting
10 silly install loadIdealTree
11 silly cloneCurrentTree Starting
12 silly install cloneCurrentTreeToIdealTree
13 silly cloneCurrentTree Finishing
14 silly loadShrinkwrap Starting
15 silly install loadShrinkwrap
16 silly loadShrinkwrap Finishing
17 silly loadAllDepsIntoIdealTree Starting
18 silly install loadAllDepsIntoIdealTree
19 silly fetchNamedPackageData express
20 silly mapToRegistry name express
21 silly mapToRegistry using default registry
22 silly mapToRegistry registry https://registry.npmjs.org/
23 silly mapToRegistry data Result {
23 silly mapToRegistry   raw: 'express',
23 silly mapToRegistry   scope: null,
23 silly mapToRegistry   escapedName: 'express',
23 silly mapToRegistry   name: 'express',
23 silly mapToRegistry   rawSpec: '',
23 silly mapToRegistry   spec: 'latest',
23 silly mapToRegistry   type: 'tag' }
24 silly mapToRegistry uri https://registry.npmjs.org/express
25 silly fetchNamedPackageData body-parses
26 silly mapToRegistry name body-parses
27 silly mapToRegistry using default registry
28 silly mapToRegistry registry https://registry.npmjs.org/
29 silly mapToRegistry data Result {
29 silly mapToRegistry   raw: 'body-parses',
29 silly mapToRegistry   scope: null,
29 silly mapToRegistry   escapedName: 'body-parses',
29 silly mapToRegistry   name: 'body-parses',
29 silly mapToRegistry   rawSpec: '',
29 silly mapToRegistry   spec: 'latest',
29 silly mapToRegistry   type: 'tag' }
30 silly mapToRegistry uri https://registry.npmjs.org/body-parses
31 silly fetchNamedPackageData mongoose
32 silly mapToRegistry name mongoose
33 silly mapToRegistry using default registry
34 silly mapToRegistry registry https://registry.npmjs.org/
35 silly mapToRegistry data Result {
35 silly mapToRegistry   raw: 'mongoose',
35 silly mapToRegistry   scope: null,
35 silly mapToRegistry   escapedName: 'mongoose',
35 silly mapToRegistry   name: 'mongoose',
35 silly mapToRegistry   rawSpec: '',
35 silly mapToRegistry   spec: 'latest',
35 silly mapToRegistry   type: 'tag' }
36 silly mapToRegistry uri https://registry.npmjs.org/mongoose
37 verbose request uri https://registry.npmjs.org/body-parses
38 verbose request no auth needed
39 info attempt registry request try #1 at 4:09:58 PM
40 verbose request id 4a1bc2d02cb1e1b0
41 http request GET https://registry.npmjs.org/body-parses
42 verbose request uri https://registry.npmjs.org/mongoose
43 verbose request no auth needed
44 info attempt registry request try #1 at 4:09:58 PM
45 http request GET https://registry.npmjs.org/mongoose
46 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
47 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
48 verbose request uri https://registry.npmjs.org/express
49 verbose request no auth needed
50 info attempt registry request try #1 at 4:09:58 PM
51 verbose etag "10J3I4BR36A96WY35G7X5YW6E"
52 http request GET https://registry.npmjs.org/express
53 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
54 info attempt registry request try #2 at 4:10:08 PM
55 http request GET https://registry.npmjs.org/body-parses
56 info attempt registry request try #2 at 4:10:08 PM
57 http request GET https://registry.npmjs.org/mongoose
58 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
59 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
60 info attempt registry request try #2 at 4:10:08 PM
61 verbose etag "10J3I4BR36A96WY35G7X5YW6E"
62 http request GET https://registry.npmjs.org/express
63 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
64 info attempt registry request try #3 at 4:11:08 PM
65 http request GET https://registry.npmjs.org/body-parses
66 info attempt registry request try #3 at 4:11:08 PM
67 http request GET https://registry.npmjs.org/mongoose
68 silly fetchPackageMetaData Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
68 silly fetchPackageMetaData     at ClientRequest.onError (C:\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:176:17)
68 silly fetchPackageMetaData     at Object.onceWrapper (events.js:290:19)
68 silly fetchPackageMetaData     at emitOne (events.js:96:13)
68 silly fetchPackageMetaData     at ClientRequest.emit (events.js:188:7)
68 silly fetchPackageMetaData     at Socket.socketErrorListener (_http_client.js:309:9)
68 silly fetchPackageMetaData     at emitOne (events.js:96:13)
68 silly fetchPackageMetaData     at Socket.emit (events.js:188:7)
68 silly fetchPackageMetaData     at connectErrorNT (net.js:1025:8)
68 silly fetchPackageMetaData     at _combinedTickCallback (internal/process/next_tick.js:74:11)
68 silly fetchPackageMetaData     at process._tickCallback (internal/process/next_tick.js:98:9)
68 silly fetchPackageMetaData  error for body-parses@* { Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
68 silly fetchPackageMetaData     at ClientRequest.onError (C:\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:176:17)
68 silly fetchPackageMetaData     at Object.onceWrapper (events.js:290:19)
68 silly fetchPackageMetaData     at emitOne (events.js:96:13)
68 silly fetchPackageMetaData     at ClientRequest.emit (events.js:188:7)
68 silly fetchPackageMetaData     at Socket.socketErrorListener (_http_client.js:309:9)
68 silly fetchPackageMetaData     at emitOne (events.js:96:13)
68 silly fetchPackageMetaData     at Socket.emit (events.js:188:7)
68 silly fetchPackageMetaData     at connectErrorNT (net.js:1025:8)
68 silly fetchPackageMetaData     at _combinedTickCallback (internal/process/next_tick.js:74:11)
68 silly fetchPackageMetaData     at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ECONNRESET' }
69 silly fetchPackageMetaData Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
69 silly fetchPackageMetaData     at ClientRequest.onError (C:\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:176:17)
69 silly fetchPackageMetaData     at Object.onceWrapper (events.js:290:19)
69 silly fetchPackageMetaData     at emitOne (events.js:96:13)
69 silly fetchPackageMetaData     at ClientRequest.emit (events.js:188:7)
69 silly fetchPackageMetaData     at Socket.socketErrorListener (_http_client.js:309:9)
69 silly fetchPackageMetaData     at emitOne (events.js:96:13)
69 silly fetchPackageMetaData     at Socket.emit (events.js:188:7)
69 silly fetchPackageMetaData     at connectErrorNT (net.js:1025:8)
69 silly fetchPackageMetaData     at _combinedTickCallback (internal/process/next_tick.js:74:11)
69 silly fetchPackageMetaData     at process._tickCallback (internal/process/next_tick.js:98:9)
69 silly fetchPackageMetaData  error for mongoose@* { Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
69 silly fetchPackageMetaData     at ClientRequest.onError (C:\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:176:17)
69 silly fetchPackageMetaData     at Object.onceWrapper (events.js:290:19)
69 silly fetchPackageMetaData     at emitOne (events.js:96:13)
69 silly fetchPackageMetaData     at ClientRequest.emit (events.js:188:7)
69 silly fetchPackageMetaData     at Socket.socketErrorListener (_http_client.js:309:9)
69 silly fetchPackageMetaData     at emitOne (events.js:96:13)
69 silly fetchPackageMetaData     at Socket.emit (events.js:188:7)
69 silly fetchPackageMetaData     at connectErrorNT (net.js:1025:8)
69 silly fetchPackageMetaData     at _combinedTickCallback (internal/process/next_tick.js:74:11)
69 silly fetchPackageMetaData     at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ECONNRESET' }
70 info attempt registry request try #3 at 4:11:08 PM
71 verbose etag "10J3I4BR36A96WY35G7X5YW6E"
72 http request GET https://registry.npmjs.org/express
73 silly get cb [ 304, undefined ]
74 verbose etag https://registry.npmjs.org/express from cache
75 verbose get saving express to C:\Users\shraddha\AppData\Roaming\npm-cache\registry.npmjs.org\express\.cache.json
76 verbose correctMkdir C:\Users\shraddha\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
77 silly resolveWithNewModule express@4.14.0 checking installable status
78 silly cache add args [ 'express@*', null ]
79 verbose cache add spec express@*
80 silly cache add parsed spec Result {
80 silly cache add   raw: 'express@*',
80 silly cache add   scope: null,
80 silly cache add   escapedName: 'express',
80 silly cache add   name: 'express',
80 silly cache add   rawSpec: '*',
80 silly cache add   spec: '*',
80 silly cache add   type: 'range' }
81 silly addNamed express@*
82 verbose addNamed "*" is a valid semver range for express
83 silly addNameRange { name: 'express', range: '*', hasData: false }
84 silly mapToRegistry name express
85 silly mapToRegistry using default registry
86 silly mapToRegistry registry https://registry.npmjs.org/
87 silly mapToRegistry data Result {
87 silly mapToRegistry   raw: 'express',
87 silly mapToRegistry   scope: null,
87 silly mapToRegistry   escapedName: 'express',
87 silly mapToRegistry   name: 'express',
87 silly mapToRegistry   rawSpec: '',
87 silly mapToRegistry   spec: 'latest',
87 silly mapToRegistry   type: 'tag' }
88 silly mapToRegistry uri https://registry.npmjs.org/express
89 verbose addNameRange registry:https://registry.npmjs.org/express not in flight; fetching
90 verbose get https://registry.npmjs.org/express not expired, no request
91 silly addNameRange number 2 { name: 'express', range: '*', hasData: true }
92 silly addNameRange versions [ 'express',
92 silly addNameRange   [ '0.14.0',
92 silly addNameRange     '0.14.1',
92 silly addNameRange     '1.0.0',
92 silly addNameRange     '1.0.1',
92 silly addNameRange     '1.0.2',
92 silly addNameRange     '1.0.3',
92 silly addNameRange     '1.0.4',
92 silly addNameRange     '1.0.5',
92 silly addNameRange     '1.0.6',
92 silly addNameRange     '1.0.7',
92 silly addNameRange     '1.0.8',
92 silly addNameRange     '2.0.0',
92 silly addNameRange     '2.1.0',
92 silly addNameRange     '2.1.1',
92 silly addNameRange     '2.2.0',
92 silly addNameRange     '2.2.1',
92 silly addNameRange     '2.2.2',
92 silly addNameRange     '2.3.0',
92 silly addNameRange     '2.3.1',
92 silly addNameRange     '2.3.2',
92 silly addNameRange     '2.3.3',
92 silly addNameRange     '2.3.4',
92 silly addNameRange     '2.3.5',
92 silly addNameRange     '2.3.6',
92 silly addNameRange     '2.3.7',
92 silly addNameRange     '2.3.8',
92 silly addNameRange     '2.3.9',
92 silly addNameRange     '2.3.10',
92 silly addNameRange     '2.3.11',
92 silly addNameRange     '2.3.12',
92 silly addNameRange     '2.4.0',
92 silly addNameRange     '2.4.1',
92 silly addNameRange     '2.4.2',
92 silly addNameRange     '2.4.3',
92 silly addNameRange     '2.4.4',
92 silly addNameRange     '2.4.5',
92 silly addNameRange     '2.4.6',
92 silly addNameRange     '2.4.7',
92 silly addNameRange     '2.5.0',
92 silly addNameRange     '2.5.1',
92 silly addNameRange     '2.5.2',
92 silly addNameRange     '2.5.3',
92 silly addNameRange     '2.5.4',
92 silly addNameRange     '2.5.5',
92 silly addNameRange     '2.5.6',
92 silly addNameRange     '2.5.7',
92 silly addNameRange     '2.5.8',
92 silly addNameRange     '2.5.9',
92 silly addNameRange     '2.5.10',
92 silly addNameRange     '2.5.11',
92 silly addNameRange     '3.0.0',
92 silly addNameRange     '3.0.1',
92 silly addNameRange     '3.0.2',
92 silly addNameRange     '3.0.3',
92 silly addNameRange     '3.0.4',
92 silly addNameRange     '3.0.5',
92 silly addNameRange     '3.0.6',
92 silly addNameRange     '3.1.0',
92 silly addNameRange     '3.1.1',
92 silly addNameRange     '3.1.2',
92 silly addNameRange     '3.2.0',
92 silly addNameRange     '3.2.1',
92 silly addNameRange     '3.2.2',
92 silly addNameRange     '3.2.3',
92 silly addNameRange     '3.2.4',
92 silly addNameRange     '3.2.5',
92 silly addNameRange     '3.2.6',
92 silly addNameRange     '3.3.0',
92 silly addNameRange     '3.3.1',
92 silly addNameRange     '3.3.2',
92 silly addNameRange     '3.3.3',
92 silly addNameRange     '3.3.4',
92 silly addNameRange     '3.3.5',
92 silly addNameRange     '3.3.6',
92 silly addNameRange     '1.0.0-beta',
92 silly addNameRange     '1.0.0-beta2',
92 silly addNameRange     '1.0.0-rc',
92 silly addNameRange     '1.0.0-rc2',
92 silly addNameRange     '1.0.0-rc3',
92 silly addNameRange     '1.0.0-rc4',
92 silly addNameRange     '2.0.0-beta',
92 silly addNameRange     '2.0.0-beta2',
92 silly addNameRange     '2.0.0-beta3',
92 silly addNameRange     '2.0.0-rc',
92 silly addNameRange     '2.0.0-rc2',
92 silly addNameRange     '2.0.0-rc3',
92 silly addNameRange     '3.0.0-alpha1',
92 silly addNameRange     '3.0.0-alpha2',
92 silly addNameRange     '3.0.0-alpha3',
92 silly addNameRange     '3.0.0-alpha4',
92 silly addNameRange     '3.0.0-alpha5',
92 silly addNameRange     '3.0.0-beta1',
92 silly addNameRange     '3.0.0-beta2',
92 silly addNameRange     '3.0.0-beta3',
92 silly addNameRange     '3.0.0-beta4',
92 silly addNameRange     '3.0.0-beta6',
92 silly addNameRange     '3.0.0-beta7',
92 silly addNameRange     '3.0.0-rc1',
92 silly addNameRange     '3.0.0-rc2',
92 silly addNameRange     '3.0.0-rc3',
92 silly addNameRange     ... 144 more items ] ]
93 silly addNamed express@4.14.0
94 verbose addNamed "4.14.0" is a plain semver version for express
95 silly cache afterAdd express@4.14.0
96 verbose afterAdd C:\Users\shraddha\AppData\Roaming\npm-cache\express\4.14.0\package\package.json not in flight; writing
97 verbose correctMkdir C:\Users\shraddha\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
98 verbose afterAdd C:\Users\shraddha\AppData\Roaming\npm-cache\express\4.14.0\package\package.json written
99 silly rollbackFailedOptional Starting
100 silly rollbackFailedOptional Finishing
101 silly runTopLevelLifecycles Finishing
102 silly install printInstalled
103 verbose stack Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
103 verbose stack     at ClientRequest.onError (C:\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:176:17)
103 verbose stack     at Object.onceWrapper (events.js:290:19)
103 verbose stack     at emitOne (events.js:96:13)
103 verbose stack     at ClientRequest.emit (events.js:188:7)
103 verbose stack     at Socket.socketErrorListener (_http_client.js:309:9)
103 verbose stack     at emitOne (events.js:96:13)
103 verbose stack     at Socket.emit (events.js:188:7)
103 verbose stack     at connectErrorNT (net.js:1025:8)
103 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:74:11)
103 verbose stack     at process._tickCallback (internal/process/next_tick.js:98:9)
104 verbose cwd C:\Users\shraddha\Desktop\Umang Sir\NodeWork\BookStore
105 error Windows_NT 10.0.14393
106 error argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
107 error node v7.4.0
108 error npm  v4.0.5
109 error code ECONNRESET
110 error network tunneling socket could not be established, cause=getaddrinfo ENOTFOUND my.proxyserver.com my.proxyserver.com:8080
111 error network This is most likely not a problem with npm itself
111 error network and is related to network connectivity.
111 error network In most cases you are behind a proxy or have bad network settings.
111 error network
111 error network If you are behind a proxy, please make sure that the
111 error network 'proxy' config is set properly.  See: 'npm help config'
112 verbose exit [ 1, true ]

1 个答案:

答案 0 :(得分:1)

错误告诉您它无法解析my.proxyserver.com的地址(getaddrinfo表示DNS查找,ENOTFOUND表示无法找到DNS条目。)

您是否打算配置代理服务器?如果是这样,域名是否正确?代理服务器是否正在运行?

如果您没有打算通过代理,也许您需要修改~/.npmrc文件。如果您的代理商无法使用,那么这超出了我们可以提供帮助的范围。