Find why npm dedupe hangs infinitely - npm

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.

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

Why is #angular/cli removed from packages when NODE_ENV=production?

When doing a npm install with NODE_ENV=production (or using --only=prod), I've noticed many packages refuse to install (even though they are listed as dependencies and not devDependencies in package.json)
Of interesting note, viewing the logs of NODE_ENV=production npm install shows these entries for the missing packages:
npm sill reify mark deleted [
npm sill reify '/Users/james.maroney/terminus/temp/terminus/node_modules/#angular/cli',
npm sill reify '/Users/james.maroney/terminus/temp/terminus/node_modules/.bin/ng'
npm sill reify ]
I haven't found any useful references online to what npm sill reify is, how it works, and why it marks packages for deletion. Is there a way to affect this?

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

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

react-native start faild, npm start faild. project is not run

react-native run-android . server is faild, I don't know how to solve it. hope someone can help me。
react-native start faild .
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node#5/5.12.0/bin/node"
"/usr/local/bin/npm" "start"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! 1#1.1.1 start: `node node_modules/react-native/local-
cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 1#1.1.1 start script 'node node_modules/react-
native/local-cli/cli.js start'.
npm ERR! Make sure you have the latest version of node.js and npm
installed.
npm ERR! If you do, this is most likely a problem with the 1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/react-native/local-cli/cli.js start
npm ERR! You can get information on how to open an issue for this
project with:
npm ERR! npm bugs 1
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls 1
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/apple/Desktop/project/reactproject/IRunning/npm-debug.log
.
Last login: Fri Jan 13 09:45:42 on ttys000
AppledeMacBook-Pro:~ apple$
/Users/apple/Desktop/project/reactproject/IRunning/node_modules/
.0.36.0#react-native/packager/launchPackager.command ; exit;
~/Desktop/project/reactproject/IRunning/node_modules/.0.36.0#react-
native/packager ~
Scanning 1631 folders for symlinks in /Users/apple/Desktop/project/reactproject/IRunning/node_modules (30ms)
┌──────────────────────────────────────────────────────────────────────── ────┐
│ Running packager on port 8081.
│
│
│
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you
│
│ prefer.
│
│
│
│ https://github.com/facebook/react-native
│
│
│
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
Cannot read property 'on' of undefined
~
Process terminated. Press <enter> to close the window
Looks like you have to reinstall or update node.js and npm. Try to follow instalation steps on this page once more:
https://facebook.github.io/react-native/docs/getting-started.html#content
Also make sure you are following instructions for correct system you are using

├── 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.