NPM Basic Error Code

Raghuraman Kesavan
Bondesk.In

--

In this post, we will look into some of the NPM Basic Error Code. These error codes we will get irrespective of any operating system we use.

  1. EPERM
  2. EACCES
  3. ENOENT
  4. ENOSPC
  5. ENOGIT

Permission Error

Lack of right Permission during npm install causes EPERM and EACCES issue.
npm ERR! code EPERM
npm ERR! code EACCES

EPERM & EACCES, First time while installing packages globally most of us will get this error and to fix this error please make sure of having to write permission for the npm cache folder.

While installing packages globally, Please make sure you are using sudo in case of mac or Linux based operating system and in windows machine try to install as an administrator or with elevated privilege.

No Such File or Directory

Lack of files in the folders or lack of node configuration files and other related files will cause ENOENT issue.

npm ERR! code ENOENT

To fix this error please make sure all the files are available in the location and make sure files got write access for the specific user Id.

No Space

Lack of space in the drive or lack of write permission will cause ENOSPC issue.

npm ERR! code ENOSPC

To fix this error, please make sure your file system got enough space and make sure you got right permissions on that file system.

Free some disk space.

No Git

The absence of git executable in the system will cause ENOGIT issue.

npm ERR! not found: git ENOGIT

All the node packages are maintained in git and all packages are pulled to local machine using git via npm.

The only solution to this problem is installing Git on your local machine.

Some of the other errors we will get with npm are

  1. SSL Error
  2. SSL Error: CERT_UNTRUSTED
  3. SSL Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
  4. SSL Error: SELF_SIGNED_CERT_IN_CHAIN
  5. Not found / Server error
  6. Invalid JSON
  7. ENOTEMPTY

SSL Errors occur mostly in lower versions of node and in higher versions, you won’t run into these issues and other issues are might be due to packages you are installing, so make sure you are installing right packages.

Next Article : Top 10 popular javascript framework

Please share if you are getting any more error with npm in the comment section. If you like it, Please share it with your social network friends and fellow developers.

Originally published at nodesimplified.com on December 19, 2017.

--

--