shesek / spark-wallet

⚡️ A minimalistic wallet GUI for c-lightning, accessible over the web or through mobile and desktop apps.
MIT License
344 stars 75 forks source link

Version 0.2.14 works, version 0.2.15 hangs #151

Closed ghost closed 4 years ago

ghost commented 4 years ago

Got it working in that it shows number of sats. Got an error message about the ...p in src/cmd.js and removed those ... (no idea what that means) but now 0.2.15 works in that it shows the green sats but not the red once. So, not good but that's more or less where the problem is. The error message:

SyntaxError: src/cmd.js: Unexpected token (36:19)
  34 |     const pays = res.pays
  35 |       .filter(p => p.status == 'complete')
> 36 |       .map(p => ({ ...p, payment_hash: hash(p.preimage) }))
     |                    ^
  37 | 
  38 |     const pay_parts = await Promise.all(
  39 |       pays.map(p => ln.listsendpays(null, p.payment_hash)))

there's another ...p

Spark-wallet version 0.2.14 is working for me, 0.2.15 is not: colored lines keep running around in circles. I'm running spark-wallet inside a browser (Chrome) on Android (version 9).

EDIT: is nodejs v8 still recommended?

EDIT: reinstalled npm and got a little further without errors with npm run dist:npm and running spark-wallet/dist/cli.js but the result is the same running around circles. Here is the new 0.2.15 output:

0.2.15 output:

Connected to c-lightning v0.9.0-2-ge7d89cd with id 02888244029c5909593038ab19f269947c720de3423e491791b46c7c92f76279b6 on network bitcoin at /home/user/.lightning/bitcoin/lightning-rpc
Loaded TLS certificate with fingerprint be:26:ff:41:(etc) from /home/user/.spark-wallet/tls

HTTPS server running on https://0.0.0.0:9737
GET / 200 10.165 ms - 810
GET /style.css 200 19.903 ms - -
GET /load-theme.js 200 2.696 ms - -
GET /swatch/dark/bootstrap.min.css 200 2.589 ms - -
GET /fonts/typeface-open-sans/index.css 200 1.833 ms - -
GET /app.js 200 1.048 ms - -
GET /fonts/typeface-open-sans/files/open-sans-latin-300.woff2 200 1.362 ms - 14932
GET /lib/instascan.js 200 0.980 ms - -
POST /rpc 200 106.562 ms - -
POST /rpc 200 7.314 ms - 698
POST /rpc 200 27.174 ms - -
POST /rpc 200 12.031 ms - -
POST /rpc 200 9.602 ms - -
POST /rpc 200 21.933 ms - -
GET /fonts/typeface-open-sans/files/open-sans-latin-400.woff2 200 2.391 ms - 14380
GET /manifest-rZXnkNFjR8/manifest.json 200 1.852 ms - 571
GET /favicon.ico 200 2.484 ms - -
GET /worker.js 200 3.728 ms - -
POST /rpc 200 2.541 ms - 698
POST /rpc 200 10.346 ms - -
POST /rpc 200 4.062 ms - -
POST /rpc 200 22.286 ms - -
POST /rpc 200 19.457 ms - -
POST /rpc 200 3.630 ms - 698
POST /rpc 200 14.475 ms - -
POST /rpc 200 7.434 ms - -
POST /rpc 200 28.324 ms - -
POST /rpc 200 24.361 ms - -
POST /rpc 200 3.657 ms - 698
POST /rpc 200 16.090 ms - -

0.2.14 output:

Connected to c-lightning v0.9.0-2-ge7d89cd with id 02888244029c5909593038ab19f269947c720de3423e491791b46c7c92f76279b6 on network bitcoin at /home/user/.lightning/bitcoin/lightning-rpc
Loaded TLS certificate with fingerprint be:26:ff:41:8d (etc) from /home/user/.spark-wallet/tls

HTTPS server running on https://0.0.0.0:9737
GET / 200 20.349 ms - 810
GET /style.css 200 64.202 ms - -
GET /load-theme.js 200 2.862 ms - -
GET /swatch/dark/bootstrap.min.css 200 76.594 ms - -
GET /app.js 200 16.977 ms - -
GET /fonts/typeface-open-sans/index.css 200 76.960 ms - -
POST /rpc 200 94.831 ms - -
POST /rpc 200 15.706 ms - -
POST /rpc 200 3.647 ms - 698
GET /fonts/typeface-open-sans/files/open-sans-latin-300.woff2 200 23.039 ms - 14932
GET /lib/instascan.js 200 22.305 ms - -
POST /rpc 200 9.416 ms - -
POST /rpc 200 3.553 ms - -
GET /fonts/typeface-open-sans/files/open-sans-latin-400.woff2 200 39.328 ms - 14380
GET /favicon.ico 200 17.485 ms - -
GET /manifest-rZXnkNFjR8/manifest.json 200 51.011 ms - 571
GET /worker.js 200 2.926 ms - -
GET /manifest-rZXnkNFjR8/icon-512.png 200 9.007 ms - 16947
GET /manifest-rZXnkNFjR8/icon-192.png 200 2.818 ms - 7526
GET /manifest-rZXnkNFjR8/icon-192.png 200 1.846 ms - 7526
GET /manifest-rZXnkNFjR8/icon-192.png 200 1.795 ms - 7526
GET /manifest-rZXnkNFjR8/icon-192.png 200 1.785 ms - 7526
GET /manifest-rZXnkNFjR8/icon-192.png 200 1.842 ms - 7526
shesek commented 4 years ago

The first errors you were seeing are because the code under src/ has to be compiled with babel first, it cannot be run directly with nodejs. You can either compile it with npm run dist:npm like you did, or use npm start -- --ln-path ... to start a dev server with on-the-fly compilation (note that the latter option is slower and a cpu hog).

As for the stuck loading screen, could you open the developer tools (Ctrl-Shift-I) and see if there are any errors there?

If you're seeing t.amount_msat is undefined, this is a bug that was fixed but still not released.

ghost commented 4 years ago

I apply git clone https://github.com/shesek/spark-wallet so already use the bug fix. The npm run dist:npm also went ok when I first do

npm i nib
npm i pugify
npm i babelify
npm i browserify-package-json
npm i browserify
npm i envify
npm i uglifyify

I did some further research. With a test lightning node (on mainnet not testnet) I removed all transactions (from lightningd.sqlite3) and spark-wallet 0.2.15 was fine (for that test node without transactions). Then I paid an invoice to my "real" lightning node and that showed up fine in spark-wallet (for the test node). But when I do a keysend transaction with my test node to my "real" node then spark-wallet (for the test node) hangs and I get the following errors in the console of crtl shift i:

Error: Not a proper lightning payment request

decode https://217.104.4.71:9738/app.js:1
    _ https://217.104.4.71:9738/app.js:1
    parsePayment https://217.104.4.71:9738/app.js:1
    it https://217.104.4.71:9738/app.js:1
    it https://217.104.4.71:9738/app.js:1
    _tryNext https://217.104.4.71:9738/app.js:1
    _next https://217.104.4.71:9738/app.js:1
    next https://217.104.4.71:9738/app.js:1
    notifyNext https://217.104.4.71:9738/app.js:1
    _next https://217.104.4.71:9738/app.js:1
    next https://217.104.4.71:9738/app.js:1
    notifyNext https://217.104.4.71:9738/app.js:1
    _next https://217.104.4.71:9738/app.js:1
    next https://217.104.4.71:9738/app.js:1
    _next https://217.104.4.71:9738/app.js:1
    next https://217.104.4.71:9738/app.js:1
    _next https://217.104.4.71:9738/app.js:1
    next https://217.104.4.71:9738/app.js:1
    notifyNext https://217.104.4.71:9738/app.js:1
    _next https://217.104.4.71:9738/app.js:1
    next https://217.104.4.71:9738/app.js:1
    _next https://217.104.4.71:9738/app.js:1
    next https://217.104.4.71:9738/app.js:1
    _n https://217.104.4.71:9738/app.js:1
    _n https://217.104.4.71:9738/app.js:1
    _n https://217.104.4.71:9738/app.js:1
    start https://217.104.4.71:9738/app.js:1
    callback https://217.104.4.71:9738/app.js:1
    v https://217.104.4.71:9738/app.js:1
    emit https://217.104.4.71:9738/app.js:1
    onreadystatechange https://217.104.4.71:9738/app.js:1

The keysend transaction was ok:

lightning-cli keysend 02888244029c5909593038ab19f269947c720de3423e491791b46c7c92f76279b6 10000
{
   "destination": "02888244029c5909593038ab19f269947c720de3423e491791b46c7c92f76279b6",
   "payment_hash": "1910e222c23342b416e6e15d03015ecf3076ed62b684c1774df897a26347f4ed",
   "created_at": 1597086328.275,
   "parts": 1,
   "msatoshi": 10000,
   "amount_msat": "10000msat",
   "msatoshi_sent": 10000,
   "amount_sent_msat": "10000msat",
   "payment_preimage": "377188933ddd25650c8ed06ac2eb6f8a6dc59474051e7375e318e00d46c7a167",
   "status": "complete"
}
shesek commented 4 years ago

@sumBTC I sent you a pm on reddit, can we chat there to diagnose this? or is there some other IM that you prefer?

shesek commented 4 years ago

The npm run dist:npm also went ok when I first do ...

Installing these dependencies manually should not be required, did you run npm install before dist:npm? (the docs were missing this until 20 minutes ago)

shesek commented 4 years ago

@sumBTC I think I found the cause, working on a fix.

shesek commented 4 years ago

I believe this should be fixed by 3eda345d17bb6a2881f2b121c005a9fef618424e, and I also future proofed against other failures to decode the bolt11 in 00266e10de1f914f9e4cdd3ea3b8ba076c3c0490.

Can you give this a try?

ghost commented 4 years ago

Yes, will report back soon

ghost commented 4 years ago

Yes, that solved it!

ghost commented 4 years ago

BTW with

$ git clone https://github.com/shesek/spark-wallet && cd spark-wallet
$ npm install
$ npm run dist:npm

I still get:

 stylus -u nib -c styl/style.styl -o ../dist/www
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module 'nib'
Require stack:
- /usr/lib/node_modules/stylus/bin/stylus
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /usr/lib/node_modules/stylus/bin/stylus:795:10
    at Array.forEach (<anonymous>)
    at usePlugins (/usr/lib/node_modules/stylus/bin/stylus:792:11)
    at /usr/lib/node_modules/stylus/bin/stylus:653:9
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/lib/node_modules/stylus/bin/stylus' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spark-client@ dist: `./build.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the spark-client@ dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2020-08-10T19_53_33_007Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spark-wallet@0.2.15 dist:npm: `./scripts/build.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the spark-wallet@0.2.15 dist:npm script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2020-08-10T19_53_33_140Z-debug.log

But if I install all those modules as above all is fine.

gruve-p commented 4 years ago

@sumBTC try this

$ git clone https://github.com/shesek/spark-wallet && cd spark-wallet && npm install
$ cd client/fonts && npm install
$ cd .. && npm install && ./fonts/rewrite-css.sh node_modules/bootswatch/dist/*/*.min.css
$ cd .. && npm run dist:npm
$ ./dist/cli.js --ln-path ~/.lightning/bitcoin
shesek commented 4 years ago

@gruve-p @sumBTC Just running npm install inside the client directory should be sufficient to resolve this.

But this should not be necessary, the dist:npm script is supposed to do automatically, I'll look into why its not. Opened #152 to track this.

gruve-p commented 4 years ago
npm WARN lifecycle spark-client@~postinstall: cannot run in wd spark-client@ (cd fonts && npm install) && ./fonts/rewrite-css.sh node_modules/bootswatch/dist/*/*.min.css (wd=/root/spark-wallet/client)
added 169 packages from 193 contributors in 27.129s

6 packages are looking for funding
  run `npm fund` for details

+ cp -r www/favicon.ico www/manifest www/notification.png www/style.css ../dist/www/
+ cp -r 'fonts/node_modules/typeface-*' ../dist/www/fonts/
cp: cannot stat 'fonts/node_modules/typeface-*': No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spark-client@ dist: `./build.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spark-client@ dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-08-10T20_59_19_265Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spark-wallet@0.2.15 dist:npm: `./scripts/build.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spark-wallet@0.2.15 dist:npm script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-08-10T20_59_19_284Z-debug.log
ghost commented 4 years ago

@gruve-p That worked. Maybe that gives some extra information to @shesek

So:

$ git clone https://github.com/shesek/spark-wallet && cd spark-wallet && npm install
$ cd client/fonts && npm install
$ cd .. && npm install && ./fonts/rewrite-css.sh node_modules/bootswatch/dist/*/*.min.css
$ cd .. && npm run dist:npm

and then running spark-wallet as usual (./dist/cli.js) worked

shesek commented 4 years ago

@sumBTC Have you tried with a simple npm install within the client directory? Did it not work?

@gruve-p I think the reason a simple npm install in the client directory didn't work for you is that you're running as root, which npm doesn't typically like. Can you try with npm install --unsafe-perm and see if that works?

ghost commented 4 years ago

Yes I did and it didn't work (sorry I should have mentioned that).

Doing:

git clone https://github.com/shesek/spark-wallet
cd spark-wallet
npm install
npm run dist:npm

gives as output:

Cloning into 'spark-wallet'...
remote: Enumerating objects: 164, done.
remote: Counting objects: 100% (164/164), done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 4578 (delta 97), reused 132 (delta 79), pack-reused 4414
Receiving objects: 100% (4578/4578), 9.48 MiB | 8.04 MiB/s, done.
Resolving deltas: 100% (3375/3375), done.

> core-js@2.6.11 postinstall /home/user/spark-wallet/node_modules/@babel/polyfill/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@3.6.5 postinstall /home/user/spark-wallet/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 580 packages from 269 contributors and audited 583 packages in 45.637s

20 packages are looking for funding
  run `npm fund` for details

found 3 vulnerabilities (1 low, 2 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

> spark-wallet@0.2.15 dist:npm /home/user/spark-wallet
> ./scripts/build.sh

+ mkdir -p dist
+ rm -rf 'dist/*'
+ babel -d dist --ignore src/transport/granax-dep/node_modules src
Successfully compiled 11 files with Babel (4518ms).
+ cp src/transport/granax-dep/package.json src/transport/granax-dep/npm-shrinkwrap.json dist/transport/granax-dep/
+ cd client
+ DEST=../dist/www
+ npm run dist

> spark-client@ dist /home/user/spark-wallet/client
> ./build.sh

+ shopt -s extglob
+ : ../dist/www
+ : production
+ : web
+ export BUILD_TARGET
+ export NODE_ENV
++ node -p 'require("../package").version'
+ export VERSION=0.2.15
+ VERSION=0.2.15
+ rm -rf '../dist/www/*'
+ mkdir -p ../dist/www ../dist/www/lib ../dist/www/fonts ../dist/www/swatch
+ [[ -d node_modules ]]
+ npm install

> secp256k1@3.8.0 install /home/user/spark-wallet/client/node_modules/secp256k1
> npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."

> secp256k1@3.8.0 rebuild /home/user/spark-wallet/client/node_modules/secp256k1
> node-gyp rebuild

make: Entering directory '/home/user/spark-wallet/client/node_modules/secp256k1/build'
  CXX(target) Release/obj.target/secp256k1/src/addon.o
  CXX(target) Release/obj.target/secp256k1/src/privatekey.o
../src/privatekey.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE privateKeyNegate(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/privatekey.cc:73:30: warning: ignoring return value of ‘int secp256k1_ec_privkey_negate(const secp256k1_context*, unsigned char*)’, declared with attribute warn_unused_result [-Wunused-result]
   secp256k1_ec_privkey_negate(secp256k1ctx, &private_key[0]);
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/secp256k1/src/publickey.o
  CXX(target) Release/obj.target/secp256k1/src/signature.o
  CXX(target) Release/obj.target/secp256k1/src/ecdsa.o
../src/ecdsa.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE sign(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ecdsa.cc:88:131: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
 (), Nan::New<v8::String>("signature").ToLocalChecked(), COPY_BUFFER(&output[0], 64));
                                                                                    ^
In file included from /home/user/.cache/node-gyp/12.18.3/include/node/node.h:67:0,
                 from ../src/ecdsa.cc:1:
/home/user/.cache/node-gyp/12.18.3/include/node/v8.h:3504:37: note: declared here
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
../src/ecdsa.cc:89:130: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
 t(), Nan::New<v8::String>("recovery").ToLocalChecked(), Nan::New<v8::Number>(recid));
                                                                                    ^
In file included from /home/user/.cache/node-gyp/12.18.3/include/node/node.h:67:0,
                 from ../src/ecdsa.cc:1:
/home/user/.cache/node-gyp/12.18.3/include/node/v8.h:3504:37: note: declared here
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
  CXX(target) Release/obj.target/secp256k1/src/ecdh.o
  CC(target) Release/obj.target/secp256k1/src/secp256k1-src/src/secp256k1.o
  CC(target) Release/obj.target/secp256k1/src/secp256k1-src/contrib/lax_der_parsing.o
  CC(target) Release/obj.target/secp256k1/src/secp256k1-src/contrib/lax_der_privatekey_parsing.o
  SOLINK_MODULE(target) Release/obj.target/secp256k1.node
  COPY Release/secp256k1.node
make: Leaving directory '/home/user/spark-wallet/client/node_modules/secp256k1/build'

> spark-client@ postinstall /home/user/spark-wallet/client
> (cd fonts && npm install) && ./fonts/rewrite-css.sh node_modules/bootswatch/dist/*/*.min.css

added 6 packages from 1 contributor and audited 6 packages in 0.861s
found 0 vulnerabilities

added 164 packages from 192 contributors and audited 789 packages in 66.213s

7 packages are looking for funding
  run `npm fund` for details

found 117 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
+ cp -r www/favicon.ico www/manifest www/notification.png ../dist/www/
+ cp -r fonts/node_modules/typeface-lato fonts/node_modules/typeface-nunito-sans fonts/node_modules/typeface-open-sans fonts/node_modules/typeface-roboto fonts/node_modules/typeface-source-sans-pro fonts/node_modules/typeface-ubuntu ../dist/www/fonts/
+ cp -r node_modules/bootswatch/dist/cerulean node_modules/bootswatch/dist/cosmo node_modules/bootswatch/dist/cyborg node_modules/bootswatch/dist/flatly node_modules/bootswatch/dist/lumen node_modules/bootswatch/dist/lux node_modules/bootswatch/dist/materia node_modules/bootswatch/dist/sandstone node_modules/bootswatch/dist/simplex node_modules/bootswatch/dist/slate node_modules/bootswatch/dist/solar node_modules/bootswatch/dist/spacelab node_modules/bootswatch/dist/superhero node_modules/bootswatch/dist/united node_modules/bootswatch/dist/yeti ../dist/www/swatch/
+ cp -r swatch/dark/ ../dist/www/swatch/
+ find ../dist/www/swatch -type f '!' -name '*.min.css' -delete
+ find ../dist/www/fonts -type f -regex '.*\.\(md\|json\)' -delete
+ ./fonts/rewrite-css.sh ../dist/www/swatch/cerulean/bootstrap.min.css ../dist/www/swatch/cosmo/bootstrap.min.css ../dist/www/swatch/cyborg/bootstrap.min.css ../dist/www/swatch/dark/bootstrap.min.css ../dist/www/swatch/flatly/bootstrap.min.css ../dist/www/swatch/lumen/bootstrap.min.css ../dist/www/swatch/lux/bootstrap.min.css ../dist/www/swatch/materia/bootstrap.min.css ../dist/www/swatch/sandstone/bootstrap.min.css ../dist/www/swatch/simplex/bootstrap.min.css ../dist/www/swatch/slate/bootstrap.min.css ../dist/www/swatch/solar/bootstrap.min.css ../dist/www/swatch/spacelab/bootstrap.min.css ../dist/www/swatch/superhero/bootstrap.min.css ../dist/www/swatch/united/bootstrap.min.css ../dist/www/swatch/yeti/bootstrap.min.css
+ [[ web == \w\e\b ]]
+ cp node_modules/instascan/dist/instascan.min.js ../dist/www/lib/instascan.js
+ [[ web != \w\e\b ]]
+ pug index.pug -o ../dist/www

  rendered /home/user/spark-wallet/dist/www/index.html
+ stylus -u nib -c styl/style.styl -o ../dist/www
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module 'nib'
Require stack:
- /usr/lib/node_modules/stylus/bin/stylus
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /usr/lib/node_modules/stylus/bin/stylus:795:10
    at Array.forEach (<anonymous>)
    at usePlugins (/usr/lib/node_modules/stylus/bin/stylus:792:11)
    at /usr/lib/node_modules/stylus/bin/stylus:653:9
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/lib/node_modules/stylus/bin/stylus' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spark-client@ dist: `./build.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the spark-client@ dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2020-08-11T05_59_02_652Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spark-wallet@0.2.15 dist:npm: `./scripts/build.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the spark-wallet@0.2.15 dist:npm script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2020-08-11T05_59_02_750Z-debug.log
shesek commented 4 years ago

@sumBTC Note that my suggestion was to run npm install inside the client subdirectory, in addition to the main directory.

Again, this should not be necessary and I will be working on a fix such that npm install in the main directory is sufficient, but in the meanwhile cd client && npm install should make it work, without manually installing the dependencies like @gruve-p suggested.

ghost commented 4 years ago

@shesek Oh haha I thought with client directory you meant the main directory of the client. So, yeah, this worked great:

git clone https://github.com/shesek/spark-wallet
cd spark-wallet/client
npm install
cd ..
npm install
npm run dist:npm
shesek commented 4 years ago

Great, thanks for confirming!

shesek commented 4 years ago

@sumBTC @gruve-p I fixed the installation bug in 0553b8706ff9946d9e22b5c05b209561994f6c29, it should now work as documented on the README.

ghost commented 4 years ago

@shesek It does! Well done. So everything is fine now. I will keep an eye on the changes at c-lightning and spark-wallet and pull the latest versions when necessary.

gruve-p commented 4 years ago

@shesek I can confirm the installation bug is now fixed