npm/statusboard

fix(config): remove deprecation warning for `--global`

Closed this issue · 7 comments

Summary

A mistake was made creating this issue & subsequently led to us issuing a warning that --global was being removed. For context, --global will be changing it's underlying behaivor to map to --location=global which maps with existing --location-aware commands (ie. npm config & in v9 npm exec)

Exit Criteria

  • running npm with --global should not warn users

References & Links

is there a work around?

@wolfpackt99 Downgrade to npm v8.10.0?

@wolfpackt99 we're shipping a patch right now to remove the deprecation warning as we speak. (ref. npm/cli#4984)

nlf commented

done! published v8.12.1 with this reversed

Is this fixed for sure in 8.12.1?

-- console output produced during zsh initialization follows --

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
❯ which npm
/Users/alexrosenfeld/.nvm/versions/node/v16.15.1/bin/npm                                                                                                                                                                                            ─╯
❯ npm --version
8.12.1
❯ which node
/Users/alexrosenfeld/.nvm/versions/node/v16.15.1/bin/node
❯ node --version
v16.15.1

@alexrosenfeld10 Perhaps the npm in your zsh initialization is a different version? Does executing a global command like npm ls -g --depth=0 from your shell prompt print the deprecation warning?

@mscdex yeah, seems like you're right - the initialization must be using a different version, because after initialization that command runs w/o a warning.