Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Context
I am using a packages npm-dist-tag in my package.json
// An example
"devDependencies": {
"nx": "canary"
}
Running npm i after adding such a dependency to the package.json works as intended, for time being 19.2.0-canary.20240528-7f11a1d of nx is being fetched and written to the package-lock.json.
dist-tag not re-evaluated
Now, I am using a npm-dist-tag, which does not exist:
"devDependencies": {
"nx": "dist-tag-not-available-oohhhhhh"
}
Running npm i after adding such a dependency does not work - which is in my opinion correct:
$ npm i
npm error code ETARGET
npm error notarget No matching version found for nx@dist-tag-not-available-oohhhhhh.
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.
But, if I first install nx=canary as I described in context, and change canary to dist-tag-not-available-oohhhhhh in the package.json afterwards, npm i just works fine. The package-lock.json remains untouched in this case, with nx still pointing to 19.2.0-canary.20240528-7f11a1d
Additional question
I wonder, what happens when nx=canary is being used, and the canary dist-tag gets updated - does npm i update the actual version of nx?
Expected Behavior
In the second case, when a npm-dist-tag in the packge.json is being changed to a non-existing one, I would expect NPM to throw an error as it does, when I try to init such a dependency.
Steps To Reproduce
- Add
nx=canary as dependency to package.json
npm i (nx is being installed)
- Change nx to
nx=dist-tag-not-available-oohhhhhh in package.json
npm i => executes just fine, nx=canary remains, no error
Environment
npm: 10.8.0
Node.js: v20.10.0
OS Name: Windows 11
System Model Name: Lenovo IdeaPad
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Context
I am using a packages npm-dist-tag in my package.json
Running
npm iafter adding such a dependency to the package.json works as intended, for time being19.2.0-canary.20240528-7f11a1dof nx is being fetched and written to the package-lock.json.dist-tag not re-evaluated
Now, I am using a npm-dist-tag, which does not exist:
Running
npm iafter adding such a dependency does not work - which is in my opinion correct:But, if I first install
nx=canaryas I described in context, and changecanarytodist-tag-not-available-oohhhhhhin the package.json afterwards,npm ijust works fine. The package-lock.json remains untouched in this case, with nx still pointing to19.2.0-canary.20240528-7f11a1dAdditional question
I wonder, what happens when
nx=canaryis being used, and thecanarydist-tag gets updated - doesnpm iupdate the actual version of nx?Expected Behavior
In the second case, when a npm-dist-tag in the packge.json is being changed to a non-existing one, I would expect NPM to throw an error as it does, when I try to init such a dependency.
Steps To Reproduce
nx=canaryas dependency to package.jsonnpm i(nx is being installed)nx=dist-tag-not-available-oohhhhhhin package.jsonnpm i=> executes just fine, nx=canary remains, no errorEnvironment
npm: 10.8.0
Node.js: v20.10.0
OS Name: Windows 11
System Model Name: Lenovo IdeaPad