2

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

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
Mustabshir Khan
  • 21
  • 1
  • 1
  • 7

2 Answers2

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.

Fernando Paz
  • 532
  • 6
  • 19
0

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