简体   繁体   中英

i can't install npm modules from npm why?

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.
  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.

Here is a link to a post that looks like addresses your question: Can't install express because npm install express error

Personally I'm of no help but hopefully you can find your answer there.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM