Can't install express because npm install express error
Solution 1
I also had a problem like that... and looking around for various solutions on the internet I tried a few of these:
- Try
npm install
to another repository - Try install another version of node.js
-
npm set registry http://registry.npmjs.org/
If the above method still fails. You can try these:
- Uninstall nodejs from Programs & Features with the uninstaller.
- Delete these files:
C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm
C:\Users\{User}\AppData\Roaming\npm-cache
-
C:\Users\{User}\.npmrc
(and possibly check for that without the.
prefix too)
- Reboot, for good measure
- Try too install node.js again
- Try too
nmp install
to destination repository
Good luck... with what I mentioned above, I was able to solve the problem with my setup.
Solution 2
I experienced this issue and based on the error message, I noticed the certificate (.crt) and the private key (.pem) files I have in the ssl folder needed to have this lines before the start and at the end of the key contents:
-----BEGIN RSA PRIVATE KEY-----
Your key contents go here for .pem file
-----END RSA PRIVATE KEY-----
The same is required for the certificate file and missing either generates the same error:
-----BEGIN CERTIFICATE-----
Your certificate contents go here for .crt file
-----END CERTIFICATE-----
Solution 3
Do the following :
Delete the following mention
- npm cache clean -f
- C:\User\user\appdata\roaming\npm-cache
- C:\User\user\appdata\roaming\npm
- C:\User\user\appdata\Local\Temp
- C:\programefile\nodejs
- delete node version manager (nvm) is their
- type where node on cmd if it shows node js path means node js is properly not uninstalled
- delete node js and npm path from environment variable
- go to this much address C:\User\user them right click on empty space and go to property and tick on hidden in order to get .npmrc file and delete all reated to it
- delete other version of node js if installed
after doing this much restart your pc and then install new latest recommended version of node js. After installed the node js run node -v to check version you installed and npm -v for npm version
Related videos on Youtube
crow
Updated on June 04, 2022Comments
-
crow almost 2 years
I'm receiving the following errors when trying to install
express
:npm ERR! code ERR_OSSL_PEM_NO_START_LINE
npm ERR! errno ERR_OSSL_PEM_NO_START_LINE
npm ERR! request to https://registry.npmjs.org/express failed, reason: error:0909006C:PEM routines:get_name:no start line
-
Moti Korets over 4 yearsWhat its the command you run? Which version of npm you have? Is it only happens for express or other packages?
-
crow over 4 yearsyes,i run on command npm version 6.10.0
-
crow over 4 yearsit be inefficient
-
Philippe Fanaro almost 4 yearsIt's good to know that uninstalling works, but it is usually a better solution to fix the specific problem, both for the user and the team who owns the software.
-
Philippe Fanaro almost 4 yearsWhat does "inefficient" mean in this context?