简体   繁体   中英

npm ERR! request to https://registry.npmjs.org/node-modules failed, reason: error:0906D06C:PEM routines:PEM_read_bio:no start line

I am getting this error while installing any JS package , I have done lots of search but no luck. So please let me know where i am making mistake.

npm ERR! request to https://registry.npmjs.org/node-modules failed, reason: error:0906D06C:PEM routines:PEM_read_bio:no start line

WebServer : Apache2(xampp)
Node : v9.3.0
NPM : 5.5.1

I think that first you need to start prompt as an administrator, then run npm cache clean -f then try to run npm install , by this command the npm will install the packages listed in package.json.

Or

You can run npm config set registry http://registry.npmjs.org/ so you can run npm install -g node-modules . Read more in this answer .

I faced the same problem and finally I was able to solve the exact above error by doing the following steps:-

  1. check version of your npm with npm -v
  2. run npm -g install npm@<version> This step is important as npm is getting installed globally here.
  3. Now run the command where you want to install something globally using npm. In my Case the command was npm install -g @angular/cli@6.2.9 which worked fine after these changes
  4. If you are still facing the problem, I would recommend to follow the instructions about installing nodejs perfectly from here https://docs.npmjs.com/try-the-latest-stable-version-of-npm#upgrading-on-windows

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