npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

前端 未结 10 1374
心在旅途
心在旅途 2020-12-07 07:50

I am trying all the ways of creating react application. I have tried with maven and now i am trying with crate-react-app build system from Facebook Incubators.

When

相关标签:
10条回答
  • 2020-12-07 08:46

    The below code worked for me perfectly here make http only instead https

    npm config set registry http://registry.npmjs.org/  
    
    0 讨论(0)
  • 2020-12-07 08:48

    I had this error when I tried to update npm, but had a really old version (1.3.6 !) installed from yum in AWS Linux. I was able to manually install a newer npm version and everything was remedied.

    0 讨论(0)
  • 2020-12-07 08:49

    what may be happening is your company decrypts certain traffic and re-encrypts it with their certificate (which you probably already have in your keychain or trusted root certificates)

    if you're using node 7 or later I've found this fix to be compatible with node and node-gyp (for Windows you'll need to do this differently, but you basically just need to add this environment variable):

    export NODE_EXTRA_CA_CERTS="absolute_path_to_your_certificates.pem" (in Windows you may need to remove the quotes - see comments)

    the pem file can have multiple certificates: https://nodejs.org/api/cli.html#cli_node_extra_ca_certs_file

    make sure your certificates are in proper pem format (you need real line breaks not literal \n)

    I couldn't seem to get it to work with relative paths (. or ~)

    This fix basically tells npm and node-gyp to use the check against the regular CAs, but also allow this certificate when it comes across it

    Ideally you would be able to use your system's trusted certificates, but unfortunately this is not the case.

    0 讨论(0)
  • 2020-12-07 08:49

    got the below error

    PS C:\Users\chpr\Documents\GitHub\vue-nwjs-hours-tracking> npm install vue npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! request to https://registry.npmjs.org/vue failed, reason: unable to get local issuer certificate

    npm ERR! A complete log of this run can be found in: npm ERR!
    C:\Users\chpr\AppData\Roaming\npm-cache_logs\2020-07-29T03_22_40_225Z-debug.log PS C:\Users\chpr\Documents\GitHub\vue-nwjs-hours-tracking> PS C:\Users\chpr\Documents\GitHub\vue-nwjs-hours-tracking> npm ERR!
    C:\Users\chpr\AppData\Roaming\npm-cache_logs\2020-07-29T03_22_40_225Z-debug.log

    Below command solved the issue:

    npm config set strict-ssl false
    
    0 讨论(0)
提交回复
热议问题