Common Errors
This tutorial is dedicated to some of the common errors that you can encounter while working with npm.
Random Errors -one place to start
- You can resolve some strange issues by running npm cache clean and trying again.
- If you are experiencing issues with npm install, you will need to use the -verbose option to see more details.
No compatible version found.
If you run npm and you receive a no compatible version found error, it means you have an outdated npm.
Permission errors
Error: ENOENT, stat 'C:\Users\
This error is a consequence of joyent/node#8141, and is specific to the node installer for Windows. The workaround this, is to ensure that C:\Users\
No space
npm ERR! Error: ENOSPC, write
This occurred because you tried to install node on a drive that either has no space or a drive that you have no permission to write.
Here are some solutions:
- Free up some disk space or
- You can set the tmp folder somewhere with more space: npm config set tmp /path/to/big/drive/tmp or
- You can build Node yourself and install it in a place that is writable, and that also has lots of space.
No git
npm ERR! not found: git```
```ENOGIT
You will need to install git. Or, you may have to add your git information to your npm profile. You can either do this from the command line or from the website.
running a Vagrant box on Windows fails because of path length issues
Here is a working solution to running a vagrant box on windows.
config.vm.provider "virtualbox" do |v|```
``` v.customize ["sharedfolder", "add", :id, "--name", "www", "--hostpath", (("//?/" + File.dirname(__FILE__) + "/www").gsub("/","\\"))]```
```End
config.vm.provision :shell, inline: "mkdir /home/vagrant/www"```
```config.vm.provision :shell, inline: "mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` > www /home/vagrant/www", run: "always"
in the code above the \\?\ appended to the current directory absolute path will force the Window API to allow an increase in the MAX_PATH variable (this is normally capped at 260).
This happens during the shared folder creation which is intentionally handled by VBoxManage and not Vagrant's "synced_folder" method.
For the last part, we are creating a new shared folder and then we will make sure it is mounted every time the machine is accessed or touched.
npm will only use git: and ssh+git: URLs for GitHub repos and breaking proxies
This issue can be solved by running the following two commands:
git config --global url."https://github.com/".insteadOf [email protected]:```
````git config --global url."https://".insteadOf git://
It should be noted that the .gitconfig used is not always the one expected so if you are on a machine that modified the home path to a shared drive, you will have to ensure that your .gitconfig is the same on both your shared drive and in c:\users\[your user]\
SSL Error
npm ERR! Error: 7684:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:787:
This error occurs because you are trying to talk SSL to an unencrypted endpoint. More often than not, this is because of a proxy configuration error. In this case, you don't want to disable strict-ssl - you may have to set up a CA / CA file for use with your proxy, but it is usually better to take the time to figure that out than disabling SSL protection.
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! Error: SSL Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
This problem happens if you're running Node 0.6. you should upgrade to node 0.8 or later.
You can try these workarounds as well:npm config set ca "" or npm config set strict-ssl false
npm ERR! Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN
npm no more supports self-signed certificates
Either:
- You upgrade your version of npm npm install npm -g --ca=""
- Or you tell your current version of npm to use known registrars npm config set ca=""
If the above does not fix the problem, it could be that you have an SSL-intercepting proxy. (For example, https://github.com/npm/npm/issues/7439#issuecomment-76024878)
SSL-intercepting proxy
Unsolved. See https://github.com/npm/npm/issues/9282
Not found / Server error
npm http 404 https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz```
```npm ERR! fetch failed https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz```
```npm ERR! Error: 404 Not Found```
```npm http 500 https://registry.npmjs.org/phonegap
- It is most likely a temporary npm registry glitch. Check your npm server status and then try again.
- If the error persists, then, most likely the published package is corrupt, you should contact the package owner.
Invalid JSON
Error: Invalid JSON
npm ERR! SyntaxError: Unexpected token <
npm ERR! registry error parsing json
This is most likely a temporary npm registry glitch, or a corrupted local server cache. You should run npm cache clean and/or try again later.
This error can be caused by corporate proxies that give HTML responses to package.json requests. Check npm's proxy configuration.
You should check that it's not a problem with a package you're trying to install (e.g. invalid package.json).
Many ENOENT / ENOTEMPTY errors in output
npm is written to efficiently use resources on install, and part of this is that it will try to do as many things concurrently as is practical. Sometimes this will result in race conditions and other synchronization issues. A large number of these issues were addressed as of [email protected] If you see errors like, ENOENT lstat, ENOENT chmod, ENOTEMPTY unlink, or anything similar in your log output. You should try updating to the latest npm version. You should lookat npm/npm#6043 to see if somebody has already discussed your issue.
cb() never called! when using shrinkwrapped dependencies
You can take a look at issue #5920, to see the progress made on this issue. This issue has been fixed in versions of npm newer than [email protected], so will have to update to the latest version of npm.
npm login errors
if you are experiencing issues while using npm login, you should log in at https://www.npmjs.com/login to confirm that you are using the correct email.
If that is not the problem, or if you see the message "may not mix password_sha and pbkdf2", then,
- You should log in at https://npmjs.com/
- Change your password or change it is also possible to change it to the same password.
- Clear the login-related fields from ~/.npmrc - e.g., using sed -ie '/registry.npmjs.org/d' ~/.npmrc
- npm login
npm hangs on Windows at addRemoteTarball
You should check if you have two temp directories set in your .npmrc:
> npm config ls -l
Then, look for lines the lines that define the tmp config variable. If you there are more than one, leave one and remove the others.
Try clearing the npm cache
There are times when npm can get confused, whenever this happens, you can reset it using this command:
npm cache clean -force
Previous: Try the latest stable version of npm
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- React - JavaScript Library
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework