i can't install npm modules from npm why?

Viewed 35928

Whenever I'm using to install some npm modules it shows the same error

For example: When I type npm install express it shows the error like this:-

npm ERR! code ERR_OSSL_PEM_NO_START_LINE
npm ERR! error:0909006C:PEM routines:get_name:no start line
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mhdra\AppData\Local\npm-cache\_logs\2021-01-14T02_04_52_493Z-debug.log

but when I try to clean npm cache using npm clean cache --force it shows some error like:-

 npm WARN using --force Recommended protections disabled.
4 Answers
  1. try npm cache clean --force
  2. delete it manually - type in windows search - run - %appdata% - delete npm-cache folder
  3. Reinstall node that should fix everything.

in run dialoge of windows type %appdata% find npm-cache folder delete it

Try this:

npm install -g npm@latest

I spent couple of hours on this error and ended up with below solution. Hope it helps:

Delete files:

  1. %appdata%\npm
  2. %appdata%\npm-cache

Follow these steps

  1. Uninstall and Install VS code(if it is your code editor)
  2. Restart your computer
  3. If you have existing repo than delete it and clone it again
  4. npm install --force
Related