Search code examples
pythonflaskheroku

Error while creating app from HerokuCLI ENOENT: ENOENT: no such file or directory....cacert.pem not found


I am getting error while creating a project on HerokuCLI.

ENOENT: ENOENT: no such file or directory, open 'C:\Users\mayur\AppData\Local\Temp\_MEI41922\certifi\cacert.pem'

I logged in via cmd:

heroku login

then typed:

heroku create todo-app

I am using latest version of HerokuCLI.


Solution

  • It is probably a bug. Caz my system not joined to any organization network.

    The CA (Certificate Authority) verifies trusted certificates for trusted roots.

    Below is the link for repository where you can find the cacert.pem file:

    https://github.com/forcedotcom/heroku-cli/blob/master/resources/cacert.pem

    Download the file or copy the text and make a new file with same name on your system "cacert.pem"

    For example: I have .pem file placed in this location. 'C:\Users\abc\OneDrive\Documents\cacert.pem'.

    Now, In 'Environment Variable', add new system variable with below given name and value.

    Variable Name: 'NODE_EXTRA_CA_CERTS'
    
    Variable Value: 'C:\Users\abc\OneDrive\Documents\cacert.pem'
    

    The problem will be fixed.