# Troubleshooting Common Issues ## Using this Document 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. If you do not find the issue below, try searching the issue tracker itself for potential duplicates before opening a new issue. 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. ### Updating this Document If you think something should be added here, make a PR that includes the following: 0. a summary 0. one or more example errors 0. steps to debug and fix 0. links to at least one related issue from the tracker For more details of the content and formatting of these entries, refer to examples below. ## Table of Contents * [Upgrading npm](#upgrading-npm) * [Proxies and Networking](#proxy-and-networking-issues) * [Cannot find module](#cannot-find-module) * [Shasum Check Fails](#shasum-check-fails) * [No Git](#no-git) ## Upgrading npm 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. You can check your npm version by running `npm -v`. ### Steps to Fix * Upgrading on \*nix (OSX, Linux, etc.) (You may need to prefix these commands with sudo, especially on Linux, or OS X if you installed Node using its default installer.) You can upgrade to the latest version of npm using: `npm install -g npm@latest` Or upgrade to the most recent LTS release: `npm install -g npm@lts` * Upgrading on Windows We have a [detailed guide](https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows) for upgrading on windows on our wiki. ## Proxy and Networking Issues 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. 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. 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. ### Steps to Fix 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. 0. Check http://status.npmjs.org/ for any potential current service outages. 0. If your company has a process for domain whitelisting for developers, make sure https://registry.npmjs.org is a whitelisted domain. 0. If you're in China, consider using https://npm.taobao.org/ as a registry, which sits behind the Firewall. 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). 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. 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. ### Example Errors This error can manifest in a wide range of different ways: ``` npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE npm ERR! unable to verify the first certificate ``` ``` npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! unable to get local issuer certificate ``` ``` npm ERR! code DEPTH_ZERO_SELF_SIGNED_CERT npm ERR! self signed certificate ``` ``` 124 error code ECONNREFUSED 125 error errno ECONNREFUSED 126 error syscall connect ``` ``` 136 error Unexpected token < 136 error 136 error
136 error