-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] NPM removes dependencies of global packages #3040
Comments
i'm not able to reproduce this.. i'm curious though, the output of
whereas when i do it, i get
are you sure you're using npm 7.8.0? the output above looks like what it did in npm 6. specifically the "and audited" part of the output was removed in npm 7. |
@nlf As stated in the issue - this is the output of The issue is consistent across various computers and operating systems. |
@ShlomiAltostra can you provide the output of |
$ npm config ls
; "user" config from /home/shlomi/.npmrc
//registry.npmjs.org/:_authToken = (protected)
; node bin location = /home/shlomi/.nvm/versions/node/v12.22.1/bin/node
; cwd = /home/shlomi
; HOME = /home/shlomi
; Run `npm config ls -l` to show all defaults. |
The latest version (7.11.1) fixed the issue. |
Current Behavior:
Updating a global package (by running
npm i -g package
) removes all its dependencies (thus rendering it broken)The first installation adds the dependencies, then a second update removes them, then adds them (and so on)
Expected Behavior:
NPM makes sure that all the dependencies of an installed global package are installed as well - and not removing them if they're already installed,
Steps To Reproduce:
npm i -g @altostra/cli
to install a global packagealto --version
: prints a version numbernpm i -g @altostra/cli
again.alto --version
: Failes due to missing dependenciesOn the second installation, NPM reports that it removed the dependencies.
Environment:
$ npm version
{
npm: '7.8.0',
node: '12.22.1',
v8: '7.8.279.23-node.46',
uv: '1.40.0',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.16.1',
modules: '72',
nghttp2: '1.41.0',
napi: '8',
llhttp: '2.1.3',
http_parser: '2.9.4',
openssl: '1.1.1k',
cldr: '37.0',
icu: '67.1',
tz: '2019c',
unicode: '13.0'
}
The text was updated successfully, but these errors were encountered: