Failed to install a npm module because of a failed git clone

lludolHOBBY

a year ago

Hello,

I am trying to setup backend on railway but I can't manage to have a working build.
I have a classic node.js (latest lts version) backend but one my dependency is "xlsx-wasm-parser" (a wasm module to parse excel files).
My repo is a monorepo and I am using PNPM (latest version).

Here is the build error:
`#11 4.731  ERROR  Command failed with exit code 128: /bin/git clone git@github.com:exsjabe/xlsx-wasm-node.git /root/.local/share/pnpm/store/v3/tmp/tmp1_8d46b68386e34602d4725b8910904617

11 4.731 Cloning into '/root/.local/share/pnpm/store/v3/tmp/tmp1_8d46b68386e34602d4725b8910904617'…

11 4.731 error: cannot run ssh: No such file or directory

11 4.731 fatal: unable to fork

11 4.731

11 4.731 pnpm: Command failed with exit code 128: /bin/git clone git@github.com:exsjabe/xlsx-wasm-node.git /root/.local/share/pnpm/store/v3/tmp/tmp1_8d46b68386e34602d4725b8910904617

11 4.731 Cloning into '/root/.local/share/pnpm/store/v3/tmp/tmp1_8d46b68386e34602d4725b8910904617'…

11 4.731 error: cannot run ssh: No such file or directory

11 4.731 fatal: unable to fork

11 4.731 at makeError (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:19342:17)

11 4.731 at handlePromise (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:19913:33)

11 4.731 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

11 4.731 at async execGit (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:112592:7)

11 4.731 at async gitFetcher (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:112546:11)

11 4.731 at async fetcher (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:131199:16)

11 4.731 at async run (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:130658:23)

11 ERROR: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1`

So as we can see we fail to git clone a repo because it's trying to clone it through SSH.
Does anyone knows how to fix that ?

0 Replies

lludolHOBBY

a year ago

Project id : 7c6b4b90-5182-4863-88ba-99fbd7a64056


lludolHOBBY

a year ago

If I setup a Dockerfile, can it bypass that bug? 🤔


maddsuaHOBBY

a year ago

Can you try cloning it over http ?


lludolHOBBY

a year ago

I can't because it's PNPM doing all the work.
On my package.json I have that : "xlsx-wasm-parser": "^0.1.2",
But if you look at the repo : https://github.com/NotoriousSledge/xlsx-wasm-parser
In the dependencies you have that :
"xlsx-wasm-browser": "github:exsjabe/xlsx-wasm-browser#e88ef46",
"xlsx-wasm-node": "github:exsjabe/xlsx-wasm-node#01b8f40",

Or maybe there is an ENV variable to setup to force cloning over http 🤔


a year ago

seems like it just needs the ssh binary?


maddsuaHOBBY

a year ago

yeeaahh buy whyyy…


a year ago

isn't cloning done with ssh by default?


lludolHOBBY

a year ago

yes it's ssh by default.
At the end to make it works, I copied the file from xlsx-wasm-node and xlsx-wasm-parser on my repo so like this no deps to clone but this is not a long term solution (but I need to make it work right now for my client 😅).


a year ago

have you taken what mad said into account? surely there's some kind of config via env that you could change


lludolHOBBY

a year ago

I tried with changing the npmrc and gitconfig files but it doesn't work. What variable can I add on the env for that?


a year ago

I am not aware of anything myself, it's something you would need to read the applicable documentation for


Failed to install a npm module because of a failed git clone - Railway Help Station