Skip to content

Commit

Permalink
create subfolder at top level of tarball from Github
Browse files Browse the repository at this point in the history
create a package dir at top level of tarball from Github
to fix bug where npm install cannot resolve dependencies.
This fix resolves ENOTCACHED errors in the preinstall phase
caused by improperly structured tarballs.

Tarballs that npm can use, package contents should reside
in a subfolder inside the tarball (usually it is called package/).
npm strips one directory layer when installing the package
(an equivalent of tar x --strip-components=1 is run).

See https://docs.npmjs.com/cli/v7/commands/npm-install

This relates to issue #45.
  • Loading branch information
tshaynik committed Oct 14, 2021
1 parent 33eb330 commit 7d3a024
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ rec {
name
{ } ''
set +x
tar -C ${src} -czf $out ./
mkdir package
cp -R ${src} package
tar -C package -czf $out ./
'';

# Description: Turns a dependency with a from field of the format
Expand Down

0 comments on commit 7d3a024

Please sign in to comment.