Skip to content

[BUG] Installing git dependencies that share dependencies with the parent package fails #2106

Description

@aredridel

ehavior:

In our main repo, grommet-styleguide is a git dependency. It depends on systemjs, as does the parent package.

With npm 7, that dependency is not where it can be found by the prepare script in grommet-styleguide.

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/Cellar/node/15.0.1/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --only=dev --prod --ignore-prepublish --no-progress --no-save --cache=/Users/aria/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --before=
npm ERR! > grommet-styleguide@2.0.2 prepare
npm ERR! > cp -a node_modules/systemjs/dist/ public/vendor/systemjs && npm run postcss && npm run rollup
npm ERR! npm WARN invalid config before="" set in command line options
npm ERR! npm WARN invalid config Must be one of: null, valid Date string
npm ERR! cp: node_modules/systemjs/dist/: No such file or directory
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/aria/.npm/_cacache/tmp/git-clone-2db8d5b0
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c cp -a node_modules/systemjs/dist/ public/vendor/systemjs && npm run postcss && npm run rollup
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/aria/.npm/_cacache/_logs/2020-11-02T15_42_36_044Z-debug.log

Expected Behavior:

When installing with npm 6, this works, and grommet-styleguide has access to systemjs when the prepare script is run, and the build completes without error.

Steps To Reproduce:

git init npm-7-bug-1
git init npm-7-bug-2
cd npm-7-bug-1
npm init --yes
npm install systemjs
jq .scripts.prepare='"cat node_modules/systemjs/dist/s.js"'  package.json > new
mv new package.json 
git add package.json
git commit -m 'test'
rm -r node_modules
cd ../npm-7-bug-2
npm init --yes
npm install systemjs
npm i ../npm-7-bug-1

Environment:

  • OS: MacOS 15
  • Node: 15.0.1
  • npm: 7.0.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions