Closed Legogris closed 3 years ago
Can you try using npm run dist
within the client
directory? This will setup PATH
correctly without having to do it manually, and also ensure that the PWD
is the client directory.
I just tried this and it worked:
$ git clone https://github.com/shesek/spark-wallet
$ cd spark-wallet/client
$ npm run dist
Is it possible that you had a previous interrupted installation that left behind an incomplete node_modules
directory?
@Legogris You should not have to install @babel/polyfill
under client
, it is already dependent on by the main package.
Make sure you run npm install
in the main directory first, as described here.
@shesek Thanks for following up! Left it in draft last night to come back with a fresh mind before submitting ;)
For context, I am attempting to fix this up for a containerized build for https://github.com/fiatjaf/sparko.
@babel/polyfill
seems to be the only thing missing to make the client module self-contained - would you agree to containing it here? (maybe sparko should change its Makefile, but I don't see why not make things modular). In general it's a common pattern.postinstall
does not execute properly for npm install
. I propose using npm --unsafe-perm
, which fixes this.To verify:
docker run --rm -it ubuntu:20.04 /bin/bash -c 'apt update && apt install -y git curl && (curl -sL https://deb.nodesource.com/setup_12.x -o- | bash) && apt install nodejs && git clone https://github.com/Legogris/spark-wallet.git && cd spark-wallet/client && git checkout fix-font-build && npm run dist'
So this will make client build independently, also as root.
@babel/polyfill
seems to be the only thing missing to make the client module self-contained - would you agree to containing it here?
Yeah, sure, I can definitely add this to client/package.json
if this makes things easier.
the issue had nothing to do with my initial commit. Since i ran this in a docker container as root,
postinstall
does not execute properly fornpm install
. I propose usingnpm --unsafe-perm
, which fixes this.
For Spark's docker image, I'm using npm config set unsafe-perm true
, which I find preferable to adding --unsafe-perm
to npm install
because it only affects the Docker environment and doesn't use unsafe perms when I'm running build.sh
directly on my host.
Could you do this in your Dockerfile too?
For Spark's docker image, I'm using
npm config set unsafe-perm true
, which I find preferable to adding--unsafe-perm
tonpm install
because it only affects the Docker environment and doesn't use unsafe perms when I'm runningbuild.sh
directly on my host.Could you do this in your Dockerfile too?
Make sense! Closing this in favor of https://github.com/shesek/spark-wallet/commit/46b789b90f2ac20f869cf1887a10470158435d99
in clean environment:
this fixes that.
CI failing addressed in #170