Stream: implementers
Topic: npm: Fetching Packages from Simplifier
Marcus Wurlitzer (Feb 24 2021 at 18:33):
Hi, I am unable to download packages from Simplifier via npm
, e.g. FHIR R4 Core. Tested with npm 7.4.3 and 7.5.6. Error ist Invalid package manifest: no 'dist.tarball' field
. Can anyone reproduce this?
Grahame Grieve (Feb 24 2021 at 22:04):
I think you need to provide more details
Eric Prud'hommeaux (Feb 24 2021 at 22:05):
@Marcus Wurlitzer , what was your npm invocation?
Marcus Wurlitzer (Feb 24 2021 at 22:43):
@Grahame Grieve @Eric Prud'hommeaux I used the command from simplifier: npm --registry https://packages.simplifier.net install hl7.fhir.r4.core@4.0.1
IIRC, it did work with an older (?) version of npm
. Or am I missing something else?
Eric Prud'hommeaux (Feb 24 2021 at 22:50):
i can reproduce the error
Eric Prud'hommeaux (Feb 24 2021 at 22:51):
not sure yet whether i can go further
Marcus Wurlitzer (Feb 24 2021 at 23:02):
Thank you. So if there is no obvious mistake, I might just send a 'feedback' to simplifier.net.
Grahame Grieve (Feb 24 2021 at 23:03):
@Ward Weistra someone should look into this?
Ward Weistra (Feb 25 2021 at 10:21):
@Marcus Wurlitzer @Eric Prud'hommeaux @Grahame Grieve
Just installed the LTS version of Node.js and NPM on my new laptop, which indeed has an older NPM (6.14.11
) and there it installs without trouble.
Does it work for you if you download the package first and then install it?
npm pack hl7.fhir.r4.core@4.0.1 --registry https://packages.simplifier.net
npm install .\hl7.fhir.r4.core-4.0.1.tgz
I really know very little about Node/NPM, perhaps @Chris Moesel or @Brian Kaney know what this is about.
Eric Prud'hommeaux (Feb 25 2021 at 13:20):
looks indeed like an incompatibility with v7 of npm. I installed a local copy of 6.14.11 and it worked:
mkdir fhirtoy &&
cd $_ && npm init -y > /dev/null &&
mkdir oldnpm &&
cd oldnpm &&
npm init -y > /dev/null && npm install npm@6.14.11 > /dev/null &&
cd .. &&
./oldnpm/node_modules/.bin/npm --registry https://packages.simplifier.net install hl7.fhir.r4.core@4.0.1
Eric Prud'hommeaux (Feb 25 2021 at 13:28):
(I stuck 6.14.11 in a oldnpm
subdir 'cause i didn't want to default to using an old npm for all npm commands run from that hierarchy)
Chris Moesel (Feb 25 2021 at 13:53):
Interesting... I don't know the differences between NPM6 and NPM7 well enough to comment on what might be going on here. I looked at the NPM7 announcement (here) and didn't see anything that looked like it would break package resolution in this way (Invalid package manifest: no 'dist.tarball' field
). It looks like they treat peer dependencies different now, but that doesn't seem to be what's going on here. Based on the error message, I guess I'd ask -- does the simplifier registry provide that "dist.tarball" field in the package manifest?
Martijn Harthoorn (Feb 25 2021 at 14:50):
Simplifier does not touch the package manifest, just serves as is.
Martijn Harthoorn (Feb 25 2021 at 15:08):
Looks like this is not about the manifest inside the package, but the package version listing API.
We'll make it compliant with npm 7 in the coming days.
If you're in a hurry. you can always use Firely.Terminal. It was built for this purpose. ;)
Grahame Grieve (Feb 25 2021 at 17:44):
@Martijn Harthoorn what changes are needed?
Marcus Wurlitzer (Feb 26 2021 at 08:38):
Thank you all for looking into this!
@Ward Weistra the pack
command gives me Cannot read property '0' of undefined
.
@Martijn Harthoorn I had chosen npm
because it is ready to run on the target machine running ubuntu, while the .NET SDK is not. So I was quite happy that npm
is provided as an option to fetch packages. :) Looking forward to your API update!
Ward Weistra (Feb 26 2021 at 10:45):
@Grahame Grieve I believe the versions endpoint needs an additional dist
entry per version with shasum
and tarball
:
image.png
Martijn Harthoorn (Mar 01 2021 at 11:28):
@Marcus Wurlitzer , wat do you mean by "ready-to-run". Because In itself .NET SDK is definitely available for Ubuntu. And Firely Terminal has been made cross platform too.
Martijn Harthoorn (Mar 01 2021 at 11:32):
@Grahame Grieve - As far as I can see the dist.shasum and dist.tarball is indeed all that is required to make it work for NPM-7, but we need to do this fix, to make sure nothing more is needed.
Marcus Wurlitzer (Mar 01 2021 at 11:35):
Martijn Harthoorn Yes - I did not mean to say that Firely Terminal is not compatible. Just that npm
is readily available on our system, while the .NET SDK
is not. This may of course be specific to our systems. Basically, this was to encourage you not to drop npm
support, if feasible. :)
Ward Weistra (Mar 25 2021 at 09:04):
@Marcus Wurlitzer Can you please try again? We've made some major changes to now precompute all package tar-balls, instead of creating them only when requested, so we can serve the dist.shasum
and dist.tarball
in the API.
Marcus Wurlitzer (Mar 25 2021 at 09:24):
@Ward Weistra I can confirm package fetching now works with npm 7.5.6/ubuntu
and npm 7.4.3/MacOS
. Thank you!
Ward Weistra (Mar 25 2021 at 09:25):
Thanks for confirming @Marcus Wurlitzer :thumbs_up:
cc @Eric Prud'hommeaux @Grahame Grieve @Chris Moesel @Brian Kaney
Last updated: Apr 12 2022 at 19:14 UTC