Skip to content
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] Git Bash on Windows - uninstalling global package doesn't remove ps1 files #954

Closed
ZaLiTHkA opened this issue Feb 27, 2020 · 3 comments
Labels
Bug thing that needs fixing platform:windows is Windows-specific Release 6.x work is associated with a specific npm 6 release

Comments

@ZaLiTHkA
Copy link

ZaLiTHkA commented Feb 27, 2020

What / Why

I'm on a Windows 10 machine with NodeJS 10.17.0 and npm@6.14.1 (I manually update NPM, but I need Node 10 for project compatibility reasons). where I use the bash.exe provided with Git 2.25.1 as my default shell. As far back as I can remember, I've always had some or other wacky issue with global packages, so I decided to take a bit of time this morning to dig into it a little more.

When

Every time I try uninstall any global package using Git Bash under Windows.

Where

  • n/a

How

Current Behavior

All package files except the PowerShell scripts (ps1 files) is removed.

Note: using either PowerShell or Command Prompt to uninstall the global package does correctly remove all files.

Steps to Reproduce

Important: run these using Git Bash in a Windows environment.

  • install any global CLI package, e.g.: npm i -g @angular/cli
  • checking in %APPDATA%\npm, we can confirm the following:
    • ng exists
    • ng.cmd exists
    • ng.ps1 exists
    • node_modules\@angular\cli\ exists and has the full Angular CLI package
  • remove global package, e.g.: npm un -g @angular/cli
  • checking in %APPDATA%\npm again, we can confirm the following:
    • ng.ps1 still exists
    • node_modules\@angular\cli\ still exists, but only contains it's node_modules folder, which in turn only contains package folders that were distributed with their own ps1 files, as per the following CMD output:
C:\Users\agreeff\AppData\Roaming\npm\node_modules\@angular\cli\node_modules>tree /F
Folder PATH listing for volume System
Volume serial number is EE0C-ADF0
C:.
├───.bin
│       JSONStream.ps1
│       mkdirp.ps1
│       rimraf.ps1
│       semver.ps1
│       sshpk-conv.ps1
│       sshpk-sign.ps1
│       sshpk-verify.ps1
│       uuid.ps1
│       which.ps1
│
├───@schematics
│   └───update
│       └───node_modules
│           └───npm-package-arg
│               └───node_modules
│                   └───.bin
│                           semver.ps1
│
├───cacache
│   └───node_modules
│       └───.bin
│               rimraf.ps1
│
├───copy-concurrently
│   └───node_modules
│       └───.bin
│               rimraf.ps1
│
├───move-concurrently
│   └───node_modules
│       └───.bin
│               rimraf.ps1
│
├───normalize-package-data
│   └───node_modules
│       └───.bin
│               semver.ps1
│
├───npm-package-arg
│   └───node_modules
│       └───.bin
│               semver.ps1
│
├───npm-pick-manifest
│   └───node_modules
│       └───.bin
│               semver.ps1
│
├───pacote
│   └───node_modules
│       └───.bin
│               rimraf.ps1
│               semver.ps1
│
└───semver-intersect
    └───node_modules
        └───.bin
                semver.ps1

Expected Behavior

I would expect all originally installed package files to be removed when uninstalling the package, regardless of which shell was used.

Who

not sure?

References

  • n/a
@ZaLiTHkA
Copy link
Author

Note: this is possibly related to #320 and #470 (which came up as "similar issues" before I posted this one), but they don't include any specific details regarding environment and/or steps to reproduce the issue.

@darcyclarke darcyclarke added Release 6.x work is associated with a specific npm 6 release platform:windows is Windows-specific Bug thing that needs fixing labels Oct 30, 2020
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

@ZaLiTHkA
Copy link
Author

ZaLiTHkA commented Jun 3, 2021

no problem at all, I myself have ditched Windows for development anyway.. Linux and Mac just make everything easier. 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing platform:windows is Windows-specific Release 6.x work is associated with a specific npm 6 release
Projects
None yet
Development

No branches or pull requests

2 participants