Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install error - unable to get local issuer certificate #9

Closed
Morningstar88 opened this issue Jul 17, 2020 · 7 comments
Closed

npm install error - unable to get local issuer certificate #9

Morningstar88 opened this issue Jul 17, 2020 · 7 comments

Comments

@Morningstar88
Copy link
Owner

Morningstar88 commented Jul 17, 2020

https://stackoverflow.com/questions/36494336/npm-install-error-unable-to-get-local-issuer-certificate

npm config set strict-ssl false

THIS MUST BE RUN FROM INSIDE THE ASSETS DIRECTORY

@Morningstar88
Copy link
Owner Author

Morningstar88 commented Jul 17, 2020

One step forward

https://stackoverflow.com/questions/36494336/npm-install-error-unable-to-get-local-issuer-certificate

Typings can be configured with the ~ / .typingsrc config file. (~ means your home directory)

After finding this issue on github: typings/typings#120, I was able to hack around this issue by creating ~/.typingsrc and setting this configuration:

{
"proxy": "http://:",
"rejectUnauthorized": false
}

After creating that file, the unable to get local issuer certificate error dissapears.

@Morningstar88
Copy link
Owner Author

"Missing write access" error when using npm

https://flaviocopes.com/npm-fix-missing-write-access-error/

sudo chown -R $USER /usr/local/lib/node_modules

Can't find usr directory

cd /usr/local

Works.

@Morningstar88
Copy link
Owner Author

Nodejs 4 introduces UNABLE_TO_GET_ISSUER_CERT_LOCALLY error for users behind company firewalls

nodejs/node#3742

TRY ANOTHER TIME:

@bnoordhius, yes, starting in v4.x my understanding is that we'll need to configure the cafile to include our company certificate chain. I've done that using npm like this:

npm config set cafile="C:\mycacert.pem"
mycacert.pem is a file containing multiple PEM formated X509 certificates in this form:

-----BEGIN CERTIFICATE-----
MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix
EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD
etc...
It8una2gY4l2O//on88r5IWJlm1L0oA8e4fR2yrBHX..adsGeFKkyNrwGi/
7vQMfXdGsRrXNGRGnX+vWDZ3/zWI0joDtCkNnqEpVn..HoX
-----END CERTIFICATE-----
I also tried setting an array of CAs following the documentation here: https://docs.npmjs.com/misc/config.

With the log level turned up to silly level.

@Morningstar88
Copy link
Owner Author

Morningstar88 commented Jul 17, 2020

Find . -name "cacert.pem"

npm config set cafile=/Path/to/your/file.pem

Path to file is in the python directory?

DIDN'T WORK. Reset config path to file in python directory so be careful in future.

@Morningstar88
Copy link
Owner Author

Reinstall NodeJS legacy

sudo apt-get install --reinstall nodejs npm nodejs-legacy

@Morningstar88
Copy link
Owner Author

Fixes Issue With Node

liip/django-ansible#52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant