How should I resolve this error that occurs when using ng new? [duplicate] - npm

This question already has answers here:
404 Not Found when trying to install ESLint 8.4.4 with create-react-app
(2 answers)
Closed 8 months ago.
I've installed the angular-cli with the command npm install -g #angular/cli. When I try to run the command ng new and create a new project, an error occurs:
⠙ Installing packages (npm)...npm WARN deprecated source-map-resolve#0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/#types/eslint/-/eslint-8.4.4.tgz - Not found
npm ERR! 404
npm ERR! 404 '#types/eslint#https://registry.npmjs.org/#types/eslint/-/eslint-8.4.4.tgz' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
How should this error be resolved?

Happening for others as well when attempting to install React or any other framework dependent on eslint.
create-react-app aborting - ESLINT not found
Heres a link to Eslint github: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/61032
A workaround for now is to run ng new app --skip-install, then add "#types/eslint": "8.4.3" to your package.json and do npm install.

include to package.json
"resolutions": {
"#types/eslint": "8.4.3"
}

I solved using an older version of the script, with this command:
npx create-react-app --scripts-version 4.0.3 app-name

Try installing the dependency locally with version 8.4.3 temporarily. It worked for me 😉
npm i -D #types/eslint#8.4.3

Related

Can't install packages using "npm install"

I am new to React native, javascript.
I am trying to install packages using npm install.
But I can't install anything. All the time I get the same error:
npm install #tensorflow/tfjs
npm ERR! 404 Object Not Found - GET https://skimdb.npmjs.com/registry/form-data/-/form-data-
3.0.1.tgz - not_found
npm ERR! 404
npm ERR! 404 'form-data#https://skimdb.npmjs.com/registry/form-data/-/form-data-3.0.1.tgz' is
not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Try this setting :
npm config set registry http://registry.npmjs.org
Yeah so depending on your correlative, there might be somethings wrong with your node in general,
you could try using
yarn
yarn add #tensorflow/tfjs

NPM 8 workspaces - Install one package as the dependency for another package in monorepo

Say I have the following structure
packages
- #my-scope/packageA
- #my-scope/packageB
- #my-scope/packageC
Let's say I want to install packageA as a dependency of packageB. With NPM 8 workspaces I would think this ought to do it:
npm install #my-scope/packageA --workspace=#my-scope/packageB
Instead I get this:
npm ERR! 404 Not Found - GET https://registry.npmjs.org/#my-scope%2fpackageA - Not found
npm ERR! 404
npm ERR! 404 '#my-scope/packageA#*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Clearly it is trying to get it from the registry (and no, I haven't published yet, not ready) but I want it to recognize that this dependency is in my project as a workspace. Anyone know why this might be happening? I haven't found many good resources explaining how to install dependencies from inside your monorepo (I don't even know what those are called...).
The problem you are facing has been reported as a bug: https://github.com/npm/cli/issues/3637
It has been marked as fixed.
Please try to install the latest version of npm (8.8.0 as of this writing) and see if your problem has been resolved.

Adding Babel plugin to Vue CLI project not working

I'm trying to add Babel to an already existing Vue CLI project. Following the directions here: https://www.npmjs.com/package/#vue/cli-plugin-babel
I tried:
vue add babel
this results in the error:
npm ERR! code E404
npm ERR! 404 Not Found - GET http://registry.npmjs.org/vue-cli-plugin-babel - Not found
npm ERR! 404
npm ERR! 404 'vue-cli-plugin-babel#latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tomlewis1/.npm/_logs/2019-10-21T17_11_26_039Z-debug.log
ERROR command failed: npm install --loglevel error -D vue-cli-plugin-babel
I've tried deleting NPM cache and updating NPM, node, and Vue CLI. Should I be specifying another registry?
I got the same error. Thinking it might be a bug, but using vue add #vue/cli-plugin-babel seems to work. Give that a try!

unable to downgrade from angular 6 to angular 5

I created my project using angular 6 but due to some reasons i want to rollback to angular 5,I tried following commands but it is showing some errors.
node version- 10.4.1
npm version-6.1.0
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #angular/cli#1.7.
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! C:\Users\TEKIZMA USER\AppData\Roaming\npm-cache\_logs\2018-06-
27T0
_21_53_446Z-debug.log
Please try to follow this Stack Answer
According to my knowledge first, try to downgrade NPM then angular.
And you might need to read this too.
Try possibly this way
npm install -g #angular/cli#YOUR_DESIRED_VERSION
You do not need to reinstall global version of Angular CLI.
Instead, you can use NPX library like:
npx -p #angular/cli#<version> new <app-name>

Can't install "react native cli" globally by using git bash

When I type in "npm install -g react-native-cli" at git bash I get following errors:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at: npm ERR! https://github.com/npm/npm/issues
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\TOSHIBA İ5\AppData\Roaming\npm-cache_logs\2017-10-19T04_04_05_774Z-debug.log
I have already installed npm and added it's directory to PATH variable and when i type "which npm" at git bash it shows the directory so there is no problem about the installation of npm. But it still gives these errors and I am stuck.
Note: I am following the instructions on https://shift.infinite.red/getting-started-with-react-native-development-on-windows-90d85a72ae65
This could happen in some npm old versions. Make sure you are using an updated one.
npm install -g npm
Some linux distros have old versions of npm and node on their packages and you need to install it manually.
Edit: I just saw you have windows. Nevermind, still the old version could be a problem.