2

I'm using github repo tag as npm module in my Firebae cloud functions project and it's working fine in local env.

//package.json
"@instantish/martian": "github:Rakmo33/martian#v2.3.0",

However, when I deploy to Firebase cloud functions it throws following error:

"Build failed: npm ERR! Error while executing:\nnpm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/Rakmo33/martian.git\nnpm ERR! \nnpm ERR! 
Host key verification failed.\nnpm ERR! fatal: Could not read from remote repository.\nnpm ERR! \nnpm ERR! 
Please make sure you have the correct access rights\nnpm ERR! and the repository exists.\nnpm ERR! \nnpm ERR! exited with error code: 128\n\nnpm ERR! 
A complete log of this run can be found in:\nnpm ERR! /www-data-home/.npm/_logs/2021-11-25T10_28_13_554Z-debug.log; Error ID: beaf8772"

1 Answer 1

5

Don't know the details of your project, but the fact is if you had executed:

npm install git+https://[email protected]/Rakmo33/martian.git#v2.3.0

you would have something like this within your package.json:

"dependencies": {
    "@rakmo33/martian_fork": "git+https://[email protected]/Rakmo33/martian.git#v2.3.0"
  }

and you'd have avoided the necessity of using any password-protected SSH keys.

Sign up to request clarification or add additional context in comments.

1 Comment

This is the correct answer, but for me, I needed to npm uninstall the dependency first, then reinstall it using the https:// protocol, and then reinstall node_modules locally. Verify in package-lock.json that it does indeed use the https protocol, because I think that's what trips up firebase-tools. This was (is?) a known issue in npm 7.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.