[npm/cli] - Warn user when latest package version is deprecated


(Adam Zerella) #1

Similar to what is outputted when a user installs a targetted deprecated package version.

npm i deprecatedPackage@1.2.3
// `npm WARN deprecated deprecatedPackage@1.2.3 ...`

we should warn the user by default when the latest package version is itself, deprecated.

E.g if the latest version was indeed 1.2.3 and that version was deprecated then the following should happen:

npm i deprecatedPackage
// `npm WARN deprecated deprecatedPackage@latest ...`

(John Gee) #2

I see something appropriate already? At least in the case the whole package had been deprecated:

$ npm init -y
$ npm install @shadowspawn/arm
...
npm WARN deprecated @shadowspawn/arm@0.0.25: Renamed to @shadowspawn/forest-arborist
...
$ npm --version
6.4.1

(Adam Zerella) #3

Yeah I believe your right, when the entire package, or a target version is deprecated.

Not when the latest version itself is deprecated and installed without a target.