If I'm using nodejs version > 12.14, then I'm receiving access error:
+ npm install eslint@8.25.0
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@bitbucket.org/someprivatereponame/someprivatereponame.git
npm ERR! Warning: Permanently added the RSA host key for IP address 'X.X.X.X' to the list of known hosts.
npm ERR! git@bitbucket.org: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-10-26T10_45_48_521Z-debug-0.log
In packages json file package specified like:
"common-module": "bitbucket:someprivatereponame
/common-module#v1.0"
where v1.0 is tag in git.
My pipeline file:
image: node:18.11 definitions: steps: - step: &lint name: Lint application caches: - node script: - npm install eslint@8.25.0 - npm run lint clone: depth: 1 pipelines: branches: master: # or the name of your main branch - step: *lint
So the question, what needs to be done to resolve this issue with private repo access? How and where I can provide ssh key?
I found the issue, it was related to passphrase protected ssh key. So for bitbucket-pipelines we should use non-passphrased keys.
Welcome to the community.
You can either generate or use your own SSH keys from your repository Pipelines SSH keys settings.
Once you have set up the SSH key there, you can copy the public SSH key and either add it to your account's settings or the private repository Access keys.
After that, you can run your Pipelines build again.
Let me know how it goes.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me try, but what's the difference, why for node v12 it's working fine, but for more new versions it's failing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BTW, I have followed all your instructions, copy my public key from repo where I have pipeline running, added this key for private package which I need to access, but no luck. I still receiving the same error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Andrey Selemenev
For your package.json file, could you try the below SSH URL connection?
"common-module": "ssh://bitbucket.org/workspace_id/repo_name.git"
If you're still getting the same error after that, I'm suspecting there's something causing it with the Node version > 12.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.