flatpak-builder-tools icon indicating copy to clipboard operation
flatpak-builder-tools copied to clipboard

node: packages using "lerna" seem to require Internet access

Open muelli opened this issue 5 years ago • 3 comments

This is more of a question than a bug, because if I understand correctly, then there is not much we can do here. Anyway, I am (again) trying to package joplin up as a flatpak. It uses "lerna": https://github.com/laurent22/joplin/blob/8d90cc234fda01c464ed68b54f5e213a6025ca9b/package.json#L27 which seems to cause some problems, because it seems to insist on connecting to the Internet. But maybe this is just caused by npm not finding the dependencies due to the symlink hackery that lerna does.

Maybe @refi64 or @gasinvein: have you encountered an app that uses lerna? I have tried to search through the flathub packages and found this instance, which then gave up and used the built version rather than building from source. Do you know what's going on there and whether the generator can support that, somehow?

FWIW: my current state is here.

muelli avatar Dec 06 '20 01:12 muelli

I can see this error:

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://github.com/laurent22/uslug.git
npm ERR! 
npm ERR! fatal: unable to access 'https://github.com/laurent22/uslug.git/': Could not resolve host: github.com
npm ERR! 
npm ERR! exited with error code: 128

Is it the only one? I guess npm doesn't like the cached version for some reason. I'm not sure if it has something to do with lerna?

gasinvein avatar Dec 06 '20 10:12 gasinvein

yeah, I'm getting

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://github.com/laurent22/node-emoji.git
npm ERR! 
npm ERR! fatal: unable to access 'https://github.com/laurent22/node-emoji.git/': Could not resolve host: github.com
npm ERR! 
npm ERR! exited with error code: 128

Interesting, that your package is different. But I have noticed that the generator result is not stable, i.e. the order of element changes, which causes quite noisy diffs. Maybe it's due to that. I also get lots of warnings:

npm WARN tar ENOENT: no such file or directory, open '/run/build/joplin/packages/app-cli/node_modules/.staging/es5-ext-ef0b051e/test/object/validate-stringifiable-value.js'
npm WARN tar ENOENT: no such file or directory, open '/run/build/joplin/packages/app-cli/node_modules/.staging/es5-ext-ef0b051e/test/object/validate-stringifiable.js'
npm WARN tar ENOENT: no such file or directory, open '/run/build/joplin/packages/app-cli/node_modules/.staging/es5-ext-ef0b051e/test/iterable/validate.js'

That, in turn, makes me wonder whether this lerna tool does some fancy filesystem trickery that doesn't work well in the sandbox.

FWIW, the messages are from this state.

muelli avatar Dec 06 '20 19:12 muelli

I've actually attempted to package an application that uses lerna. Unfortunately lerna does not support offline building or caches. Upstream is in a state of maintenance only so this will probably never be resolved

Lunarequest avatar Aug 22 '21 16:08 Lunarequest