프로젝트

일반

사용자정보

통계
| 개정판:

root / HServer / 00.Server / 00.Program / node_modules / npm / TROUBLESHOOTING.md

이력 | 보기 | 이력해설 | 다운로드 (7.81 KB)

1
# Troubleshooting Common Issues
2

    
3
## Using this Document
4

    
5
Search for the error message you're getting and see if there's a match, or skim the [table of contents](#table-of-contents) below for topics that seem relevant to the issue you're having. Each issue section has steps to work around or fix the particular issue, and have examples of common error messages.
6

    
7
If you do not find the issue below, try searching the issue tracker itself for potential duplicates before opening a new issue.
8

    
9
If you're reading this document because you noticed an issue with npm's web site, please let the [web team](https://github.com/npm/www/issues) know.
10

    
11
### Updating this Document
12

    
13
If you think something should be added here, make a PR that includes the following:
14

    
15
0. a summary
16
0. one or more example errors
17
0. steps to debug and fix
18
0. links to at least one related issue from the tracker
19

    
20
For more details of the content and formatting of these entries, refer to examples below.
21

    
22
## Table of Contents
23

    
24
* [Upgrading npm](#upgrading-npm)
25
* [Proxies and Networking](#proxy-and-networking-issues)
26
* [Cannot find module](#cannot-find-module)
27
* [Shasum Check Fails](#shasum-check-fails)
28
* [No Git](#no-git)
29

    
30
## Upgrading npm
31

    
32
Whenever you get npm errors, it's a good idea to first check your npm version and upgrade to latest whenever possible. We still see people running npm@1 (!) and in those cases, installing the latest version of npm usually solves the problem.
33

    
34
You can check your npm version by running `npm -v`.
35

    
36
### Steps to Fix
37
* Upgrading on \*nix (OSX, Linux, etc.)
38

    
39
(You may need to prefix these commands with sudo, especially on Linux, or OS X if you installed Node using its default installer.)
40
You can upgrade to the latest version of npm using:
41
`npm install -g npm@latest`
42
Or upgrade to the most recent LTS release:
43
`npm install -g npm@lts`
44

    
45
* Upgrading on Windows
46

    
47
We have a [detailed guide](https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows) for upgrading on windows on our wiki.
48

    
49
## Proxy and Networking Issues
50

    
51
npm might not be able to connect to the registry for various reasons. Perhaps your machine is behind a firewall that needs to be opened, or you require a corporate proxy to access the npm registry. This issue can manifest in a wide number of different ways. Usually, strange network errors are an instance of this specific problem.
52

    
53
Sometimes, users may have install failures due to Git/Github access issues. Git/GitHub access is separate from npm registry access. For users in some locations (India in particular), problems installing packages may be due to connectivity problems reaching GitHub and not the npm registry.
54

    
55
If you believe your network is configured and working correctly, and you're still having problems installing, please let the [registry team](https://github.com/npm/registry/issues) know you're having trouble.
56

    
57
### Steps to Fix
58

    
59
0. Make sure you have a working internet connection. Can you reach https://registry.npmjs.org? Can you reach other sites? If other sites are unreachable, this is not a problem with npm.
60

    
61
0. Check http://status.npmjs.org/ for any potential current service outages.
62

    
63
0. If your company has a process for domain whitelisting for developers, make sure https://registry.npmjs.org is a whitelisted domain.
64

    
65
0. If you're in China, consider using https://npm.taobao.org/ as a registry, which sits behind the Firewall.
66

    
67
0. On Windows, npm does not access proxies configured at the system level, so you need to configure them manually in order for npm to access them. Make sure [you have added the appropriate proxy configuration to `.npmrc`](https://docs.npmjs.com/misc/config#https-proxy).
68

    
69
0. If you already have a proxy configured, it might be configured incorrectly or use the wrong credentials. Verify your credentials, test the specific credentials with a separate application.
70

    
71
0. The proxy itself, on the server, might also have a configuration error. In this case, you'll need to work with your system administrator to verify that the proxy, and HTTPS, are configured correctly. You may test it by running regular HTTPS requests.
72

    
73
### Example Errors
74

    
75
This error can manifest in a wide range of different ways:
76

    
77
```
78
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
79
npm ERR! unable to verify the first certificate
80
```
81
```
82
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
83
npm ERR! unable to get local issuer certificate
84
```
85
```
86
npm ERR! code DEPTH_ZERO_SELF_SIGNED_CERT
87
npm ERR! self signed certificate
88
```
89
```
90
124 error code ECONNREFUSED
91
125 error errno ECONNREFUSED
92
126 error syscall connect
93
```
94
```
95
136 error Unexpected token <
96
136 error <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
97
136 error <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
98
136 error <TITLE>ERROR: Cache Access Denied</TITLE>
99
```
100
```
101
31 verbose stack Error: connect ETIMEDOUT 123.123.123.123:443
102
```
103
```
104
108 error code EAI_AGAIN
105
109 error errno EAI_AGAIN
106
110 error syscall getaddrinfo
107
111 error getaddrinfo EAI_AGAIN proxy.yourcorp.com:811
108
```
109
```
110
npm ERR! Error: getaddrinfo ESRCH
111
npm ERR! at errnoException (dns.js:37:11)
112
npm ERR! at Object.onanswer as oncomplete
113
```
114
```
115
35 error Unexpected token u
116
35 error function FindProxyForURL(url, host) {
117
```
118

    
119
### Related issues
120
* [#14318](https://github.com/npm/npm/issues/14318)
121
* [#15059](https://github.com/npm/npm/issues/15059)
122
* [#14336](https://github.com/npm/npm/issues/14336)
123

    
124
## Cannot find module
125

    
126
If *when running npm* (not your application), you get an error about a module not being found, this almost certainly means that there's something wrong with your npm installation.
127

    
128
If this happens when trying to start your application, you might not have installed your package's dependencies yet.
129

    
130
### Steps to Fix
131

    
132
0. If this happens when you try to start your application, try running `npm install` to install the app's dependencies. Make sure all its actual dependencies are listed in `package.json`
133

    
134
0. If this happens on any npm command, please reinstall.
135

    
136
### Examples
137

    
138
```
139
module.js:338
140
    throw err;
141
          ^
142
Error: Cannot find module
143
```
144
### Related Issues
145

    
146
* [#14699](https://github.com/npm/npm/issues/14699)
147

    
148
## Shasum Check Fails
149

    
150
This is a common issue which used to be caused by caching issues. Nowadays, the cache has been improved, so it's likely to be an install issue, which can be caused by network problems (sometimes even [proxy issues](#proxy-and-networking-issues)), a node bug, or possibly some sort of npm bug.
151

    
152
### Steps to Fix
153

    
154
0. Try running `npm install` again. It may have been a momentary hiccup or corruption during package download.
155

    
156
0. Check http://status.npmjs.org/ for any potential current service outages.
157

    
158
0. If the shasum error specifically has `Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709`, with this exact shasum, it means the package download was empty, which is certainly a networking issue.
159

    
160
0. Make sure your [network connection and proxy settings](#proxy-and-networking-issues) are ok.
161

    
162
0. Update your node version to the latest stable version.
163

    
164
### Examples
165

    
166
```
167
npm ERR! shasum check failed for C:\Users\some-user\AppData\Local\Temp\npm-9356-7
168
d74e411\registry.npmjs.org\some-package\-\some-package-1.0.0.tgz
169
npm ERR! Expected: 652294c14651db29fa93bd2d5ff2983a4f08c636
170
npm ERR! Actual:   c45474b40e6a7474633ec6f2b0315feaf15c61f2
171
npm ERR! From:     https://registry.npmjs.org/some-package/-/some-package-1.0.0.tgz
172
```
173

    
174
### Related Issues
175
* [#14720](https://github.com/npm/npm/issues/14720)
176
* [#13405](https://github.com/npm/npm/issues/13405)
177

    
178
## No Git
179
If your install fails and you see a message saying you don't have git installed, it should be resolved by installing git.
180

    
181
### Steps to Fix
182

    
183
0. [Install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) following the instructions for your machine.
184

    
185
### Examples
186

    
187
npm ERR! not found: git
188
ENOGIT
189

    
190
### Related Issues
191

    
192
* [#11095](https://github.com/npm/npm/issues/11095)