npm uninstall gives no error, but also doesn't remove package? - npm

I want to remove package #rollup/plugin-graphql#1.1.0 but npm uninstall simply doesn't remove it:
Check installed packages:
npm list --depth=0
├── #apollo/client#3.5.8
├── #rollup/plugin-graphql#1.1.0
// some more packages
Remove package:
npm uninstall #rollup/plugin-graphql#1.1.0
up to date, audited 334 packages in 1s
53 packages are looking for funding
run `npm fund` for details
Check installed packages again:
npm list --depth=0
├── #apollo/client#3.5.8
├── #rollup/plugin-graphql#1.1.0 // <-- still here!
// some more packages
What's going on here? packages.json also doesn't get changed.
I am on npm 8.3.0, node 16.13.1

Related

No matching version found for #typescript-eslint/typescript-estree#5.36.1

I am trying to do 'npx create-react-app react-app' and all troubleshooting I have tried so far is receiving the following error:
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #typescript-eslint/typescript-estree#5.36.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2022-08-30T16_43_36_865Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting react-app/ from /Users/user/Malauzai/React-Practice/Ex_Files_React_js_EssT/Exercise Files/Ch04/04_01/start
Done.
From digging around a bit on stackoverflow and other sites, I see previous similar examples of failures that were due to a package from the author being bad. I see from the package's npmjs.com page that this latest version was just released 2 hrs ago or so. My guess is that there's an issue in this package causing my failures. At this point I do not see an issue about this on the package's site (https://github.com/typescript-eslint/typescript-eslint/issues). I was not having this or any issues when running create-react-app as of yesterday.
I tried changing nvm version to 16.17.0 (LTS at this time), 16.14.0 and 14.18.1 in hopes that one of these would help pull in a previous version of the #typescript-eslint/typescript-estree library. I have tried uninstalling and reinstalling create-react-app globally, restarting my system and running the script in different directories to see if perhaps something was corrupted. To this point, none of these things has helped.
So I would like to ask: What other things would others suggest to perhaps address this issue or work around it in the mean time while a fix is issued?
It appears my suspicion is confirmed. NPM must have noticed the issue and fixed via rolling back the version of the affected package. After finally being able to run 'npx create-react-app react-app' successfully, I looked into the node_mudules installed with the project.
By listing out installed node_modules via 'npm ls #typescript-eslint/typescript-estree' command I see that version 5.36.0 is nested under the react-scripts package. The installs now complete and all is well. Attached below is the dependency tree showing what I just mentioned.
└─┬ react-scripts#5.0.1
└─┬ eslint-config-react-app#7.0.1
├─┬ #typescript-eslint/eslint-plugin#5.36.0
│ ├─┬ #typescript-eslint/type-utils#5.36.0
│ │ └── #typescript-eslint/typescript-estree#5.36.0
│ └─┬ #typescript-eslint/utils#5.36.0
│ └── #typescript-eslint/typescript-estree#5.36.0 deduped

Find why npm dedupe hangs infinitely

I'm trying to flatten my dependency tree. When I'm using command
npm dedupe
It just hangs eating processor and even after half an hour it does not respond...
When I execute npm -ddd dedupe to see what is happening (-ddd sets loglevel to silly level most verbosive possible)
I see that it hangs after building ideal tree:
npm sill idealTree ├─┬ yargs-parser#5.0.0-security.0
npm sill idealTree │ └── camelcase#3.0.0
npm sill idealTree ├─┬ yargs#7.1.1
npm sill idealTree │ └── camelcase#3.0.0
npm sill idealTree └── yup#0.31.0
npm sill dedupe generateActionsToTake
And it hangs on npm sill dedupe generateActionsToTake.
What can be reason of this? npm doctor says this:
Check Value Recommendation
npm ping ok
npm -v v6.14.9
node -v v14.15.1
npm config get registry https://registry.npmjs.org/
which git /usr/bin/git
Perms check on cached files ok
Perms check on global node_modules ok
Perms check on local node_modules ok
Verify cache contents verified 10269 tarballs
I don't know what else should I check. I noticed also that this is happening only in one of my project.

Npm installed in npm global?

So I'm trying to see what npm packages I have installed globally using this command,
$ npm list -g --depth=0
and I see this,
/usr/local/lib
├── npm#5.5.1
Is npm installed as a package under npm itself? Or did I screw up somewhere and caused some kinda inception installation?
You can use npm ls command to view all the npm packages in your local system

npm install unmet dependencies

I'm trying to install vue-pagination-2 (https://github.com/matfish2/vue-pagination-2) in my application.
I run the following command:
npm install --save vue-pagination-2
but I keep getting this error:
my_project/myProject
├── UNMET PEER DEPENDENCY eslint#3.19.0
└── UNMET PEER DEPENDENCY vue#2.2.6
So I run:
npm install --save vue#2.2.6
But I get exactly the same error.
How can vue#2.2.6 be an unmet dependency since I'm installing exactly that package?
I have already tried to delete node_modules folder and running npm install again.
How can I solve this?
Moreover my package.json file already have those version installed:
"eslint": "^3.19.0",
"vue": "^2.2.6",

├── UNMET PEER DEPENDENCY generator-karma#>=0.9.0

So basically I want to understand why when I run npm install sass-loader node-sass --save-dev I get this error
├── UNMET PEER DEPENDENCY generator-karma#>=0.9.0
However it's clear that Karma is installed since when I run npm install generator-karma I see that :
└─┬ generator-karma#2.0.0 <--- Which mean karma is there...
└─┬ yeoman-generator#0.22.6
├── async#1.5.2
...
I've read answer explaining I should use npm install -g grunt-cli bower yo generator-karma generator-angular but this is not helping much.
Should I uninstall and reinstall a clean node_modules ?
npm no longer installs module dependencies automatically. That means you have to install the dependencies modules yourself. Basically if you run npm install generator-karma#>=0.9.0 and then run the your previous npm install command you should be good to go.