Uh oh!
There was an error while loading. Please reload this page.
install: correct reqBy spec for opt deps - #117
Conversation
Return the correct spec for optional dependencies in getRequested. See https://npm.community/t/242
larsgw
commented
Dec 13, 2018
As with #115:
Ideas are welcome. |
aeschright
commented
Jan 7, 2019
This patch won't resolve the underlying problem -- we actually need to fix what's being put into the package-lock.json so that optional git dependencies are stored using the same format as the others. |
larsgw
commented
Jan 8, 2019
If I remember correctly, that's what this patch is supposed to do (I'll check this afternoon). Or are you suggesting a more general fix? |
I checked, given this {
"name": "060",
"version": "1.0.0",
"optionalDependencies": {
"left-pad": "git+https://github.com/jeffora/left-pad.git#custom-left-pad"
}
}
..."left-pad": {
"version": "1.3.0",
"resolved": "git+https://github.com/jeffora/left-pad.git#806c9eda55a3ac4ad365a344ac9024c3ea183f8c",
"optional": true
}
...While my patch produces this: ..."left-pad": {
"version": "git+https://github.com/jeffora/left-pad.git#806c9eda55a3ac4ad365a344ac9024c3ea183f8c",
"from": "git+https://github.com/jeffora/left-pad.git#custom-left-pad",
"optional": true
}
...The latter works with I'll try to add tests (given #115 (comment)) later, but not before my thoughts are confirmed of course. |
iarna
commented
Jan 10, 2019
We DO want output like what you quoted, but I'm concerned about your patch for this reason. You wrote this:
And the thing is, because |
iarna
commented
Jan 10, 2019
If your patch does fix something, it means something else has gone very wrong somewhere along the way, and we should patch that. |
gurpreetatwal
commented
Jan 17, 2019
Hi all, so I stepped through the code and I believe I have figured out where along the way things went bad. Specifically, it's in the Lines 63 to 70 in ab0f026 It replaces Also the I'm not sure what the fix is here as I don't understand the npm code too well, but willing to offer more help if I can get some pointers. |
It seems the new letpkgtry{pkg=parseJSON(packagejson)}catch(ex){returnnext(ex)}As for the tests, I'm not really sure. |
DrSensor
commented
Jan 29, 2019
Hi, I also bump a similar issue but with package-lock.json {
..."@obot/cli": {
"version": "0.2.1",
"resolved": "/home/wildan/Projects/OSS/bot-byte/packages/cli",
"optional": true,
"requires": {
"@oclif/command": "^1.5.8",
"@oclif/config": "^1.12.0",
"@oclif/errors": "^1.2.2",
"@oclif/plugin-help": "^2.1.4"
},
"dependencies": {...}
},
...
}package.json {
..."optionalDependencies": {
"@obot/cli": "file:packages/cli"
}
...
}$ npm cinpm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.npm ERR!npm ERR!npm ERR! Invalid: lock file's @obot/cli@0.2.1 does not satisfy @obot/cli@file:packages/clinpm ERR!npm ERR! A complete log of this run can be found in:npm ERR! /home/wildan/.npm/_logs/2019-01-29T09_06_29_704Z-debug.log |
gurpreetatwal
commented
Feb 17, 2019
@zkat@iarna any thoughts on the above solution? I'd love to help implement, just need some guidance. This same fix also fixes another issue my team is experiencing with |
larsgw
commented
Feb 17, 2019
How can I help you? BTW, another possible solution: save |
Are there any updates on this? I have optional dependencies that can't currently be pushed to a registry. |
🤖 I have created a release *beep* *boop* --- ## [4.0.4](npm/bin-links@v4.0.3...v4.0.4) (2024-05-04) ### Bug Fixes * [`100a4b7`](npm/bin-links@100a4b7) [npm#117](npm/bin-links#117) linting: no-unused-vars (@lukekarrys) ### Chores * [`e955437`](npm/bin-links@e955437) [npm#117](npm/bin-links#117) bump @npmcli/template-oss to 4.22.0 (@lukekarrys) * [`b602aca`](npm/bin-links@b602aca) [npm#117](npm/bin-links#117) postinstall for dependabot template-oss PR (@lukekarrys) * [`955cc34`](npm/bin-links@955cc34) [npm#116](npm/bin-links#116) bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot]) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Return the correct spec for optional dependencies in getRequested.
See https://npm.community/t/242