deprecation message not shown on package install

(Dustin Popp) #1

What I Wanted to Do

I marked a package, watson-developer-cloud, as deprecated (using npm deprecate watson-developer-cloud -m "my message") since I moved the package under a new name.

I was expecting an NPM warning when I installed the package, telling me to move to the new package.

What Happened Instead

The deprecation message is displayed on the NPM website, as expected. However, when I install the package from the CLI, the deprecation message is not shown. See more details below.

Reproduction Steps

  1. Create a new directory and inside, run npm init -y
  2. Run npm i watson-developer-cloud (I see no deprecation message here)
  3. Run rm -rf node_modules/ package-lock.json
  4. Run npm i (Here, I do see the deprecation message)

Details

The messages is printed sometimes as described, but I want to see it every time.

Platform Info

$ npm --versions

{ sandbox: '1.0.0',
  npm: '6.9.0',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.4',
  openssl: '1.0.2n',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.50',
  zlib: '1.2.11' }

$ node -p process.platform

darwin
0 Likes

(John Gee) #2

I was not able to reproduce your issue. I see the deprecation message when I follow your steps in an empty folder:

$ npm init -y
$ npm i watson-developer-cloud
npm WARN deprecated watson-developer-cloud@4.0.1: DeprecationWarning: watson-developer-cloud moved to ibm-watson. To get updates, use the new package.
npm WARN deprecated @types/file-type@10.9.1: This is a stub types definition. file-type provides its own type definitions, so you do not need this installed.
0 Likes

(Dustin Popp) #3

@shadowspawn Thanks for responding. It’s a relief that users could be seeing the deprecation message but it is strange that it doesn’t show up for me. I don’t have any settings in my .npmrc file that should affect this. I am running the same steps in an empty folder. I see the deprecation message for @types/file-type but that is it.

Could it be an OS issue? I am running macOS 10.14.4

0 Likes

(John Gee) #4

Perhaps some interaction with cache from before deprecation?

npm cache clear --force
0 Likes

(Dustin Popp) #5

I guess that was it! It’s working now. Can’t believe I didn’t think of that. Thanks for your help @shadowspawn

I’m not sure how to close the issue but it is resolved for me.

2 Likes