-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Bugthing that needs fixingthing that needs fixingRelease 6.xwork is associated with a specific npm 6 releasework is associated with a specific npm 6 release
Description
What / Why
When installing a package by referring to a git URL (e.g. git+https://github.com/hakimel/reveal.js.git#semver:^4.0.2) its dependencies won't be installed. It appears that this applies to various cases:
- if the package dependencies are defined as
devDependencies npmbehaves differently depending on where the URL is defined (CLI parameter vspackage.json)- whether the URL ends with a
#$COMMIT_HASHor#semver:$VERSION
For more details, please see the section Steps to Reproduce
When
- n/a
Where
npm install
How
Current Behavior
- please see below
Steps to Reproduce
(1) devDependencies vs. dependencies
# does not install dependencies, only places repository content under `./node_modules/reveal.js` as is
npm install 'git+https://github.com/hakimel/reveal.js.git#semver:^4.0.2'
# does install dependencies (see [diff](https://github.com/hakimel/reveal.js/compare/4.0.2...lucendio:4.0.3))
npm install 'git+https://github.com/lucendio/reveal.js.git#semver:^4.0.3'(2) CLI vs package.json
{
"dependencies": {
"reveal.js": "git+https://github.com/lucendio/reveal.js.git#semver:^4.0.3"
}
}# does not install dependencies
npm install# does install dependencies
npm install 'git+https://github.com/lucendio/reveal.js.git#semver:^4.0.3'(3) $GIT_URL#semver:$VERSION vs $GIT_URL#$COMMIT_HASH in package.son
{
"dependencies": {
"reveal.js": "git+https://github.com/lucendiio/reveal.js.git#semver:^4.0.3"
}
}# does not install dependencies and does not even place repository content under `./node_modules/reveal.js`
npm install{
"dependencies": {
"reveal.js": "git+https://github.com/lucendiio/reveal.js.git#93b22ec67753506f55bc7cb8fed6a62d07c89141"
}
}# does install dependencies
npm installRemarks
$GIT_URL#semver:$VERSIONinpackage.jsonhas worked untilnpm@v6.8.0- git URL +
devDependenciesinpackage.jsonnever seem to have worked (tested v5.0.0 and multiple v6.x.0) reveal.jssolely functions as an example and seems to have nothing to do with the behaviour described above- the existence of a
^does not change anything in the behaviour described above - used
node@v12.18.2andnpm@6.14.6
Expected Behavior
- dependencies - regardless of where defined:
*dependencies- are being installed when package is installed via git URL - both version specifications - commit ID and tag - are supported
- npm consolidates/optimizes dependency tree installed under
node_modulesas expected compared to when installing from npmjs.org
Who
- n/a
References
- possibly related to [BUG] Installing dependencies from git+ssh is broken in 6.14.0 #948
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingRelease 6.xwork is associated with a specific npm 6 releasework is associated with a specific npm 6 release