ERR while trying to download npm packages for VSCode - node.js

It´s my firts time working with Visual Studio Code and I tried to install npm packages that were alredy required in a project. But a bunch of errors that I have never seen showed up.
$ npm install
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad#1.3.0: use String.prototype.padStart()
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
I tried downloading Core-js,fsevents and chokidar but the same error showed up again and again.

Related

Is there a way to resolve this "npm install" issue?

I have a Vue 2 project running on a windows 10 system. My Node version is v16.13.0 and npm is 8.5.0. I got some errors when I tried serving the app, so I deleted the node_modules folder and tried to reinstall the packages. However, I keep on getting this instead.
npm WARN deprecated loadash#1.0.0: Package is unsupport. Please use the lodash package instead.
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated eslint-loader#2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated html-webpack-plugin#3.2.0: 3.x is no longer supported
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
[##################] | reify:rxjs: timing reifyNode:node_modules/core-js Completed in 142899ms
This process gets stuck at the above line after which you get the following errors:
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated eslint-loader#2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated html-webpack-plugin#3.2.0: 3.x is no longer supported
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm ERR! code UNKNOWN
npm ERR! syscall lstat
npm ERR! path C:\Users\USER\AppData\Local\npm-cache\_cacache\content-v2\sha512\9d\0c\a9d28d7f98d75b4ced4f3ba9079304ab9a0674313fe3082a4d8b06d48c6a11378765061a89b6842e0a710e2b3813570834656882a10cba4b131e6d0561f0
npm ERR! errno -4094
npm ERR! UNKNOWN: unknown error, lstat 'C:\Users\USER\AppData\Local\npm-cache\_cacache\content-v2\sha512\9d\0c\a9d28d7f98d75b4ced4f3ba9079304ab9a0674313fe3082a4d8b06d48c6a11378765061a89b6842e0a710e2b3813570834656882a10cba4b131e6d0561f0'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Local\npm-cache\_logs\2022-02-16T09_14_55_692Z-debug-0.log
I have the same issue when run npm i or npm i --legacy-peer-deps or npm i --force. I found this article is quite usefull : https://sebhastian.com/npm-warn-deprecated/ by running npm install --loglevel=error and solved my problem

how to handle deprecation messages from create-react-app?

I'm creating new react project by npx create-react-app my-app. It works fine. but when i delete the node-modules folder and use npm install,(same thing as cloning from remote repo) i get a lot of deprecation message. I'm not adding anything extra and the project runs fine but why am I getting all this deprecation messages ? can i do something about it or it is upto maintainers of various modules ?
node -v = v14.16.1
npm -v = 7.11.2
deprecation messages -
npm WARN deprecated request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
npm WARN deprecated rollup-plugin-babel#4.4.0: This package has been deprecated and is no longer maintained. Please use #rollup/plugin-babel.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js#2.6.12: core-js#<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
It's up to create-react-app maintainers to deal with this. The only thing you should do is to follow releases of "react-scripts" on github. So you would be up to date with fixes.
The only warnings you can fix are "peer dependencies" warnings ... You may install them ... or not :D

i am using angular 11 i want to do a project but i got errors

ng serve
An unhandled exception occurred: Cannot find module '#angular-devkit/build-angular/package.json'
See "/tmp/ng-lQbnUK/angular-errors.log" for further details.
and when i create the project i got those errors
installing packages (npm)...npm WARN deprecated tslint#6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...p2zraxyqI5tT/g9UTBUgK'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/safa/.npm/_logs/2021-02-15T15_46_03_482Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.
Delete node modules folder & package-lock.json file.
Run again
npm install
ng serve
if that doesn't work, upgrade the dependencies with
npm update
Delete node-modules folder
Then npm i
if error presist again then
npm i #angular-devkit/build-angular

Whenever I try to install npm packages these WARN messages show up

1. npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
2. npm WARN deprecated browserslist#1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
3. npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
4. npm WARN deprecated har-validator#5.1.5: this library is no longer supported npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
5. npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
I tried several commands like npm clean cache --force, and npm install npm #latest and others. However, this problem has not been solved.
It means that some of the modules you have in your dependencies actually depend on these outdated packages. npm clean cache won't help unfortunately.
To rectify the issue you first need to analyse package-lock.json file - it contains all the tree of interdependencies of all modules involved in your. And then when you find all the modules depending on outdated modules you have potentially 3 options:
Find a package with the similar functionality which does not depend on outdated modules
Upgrade to a newer version in hope that the dependency also was upgraded
Post an issue to the author (if possible) to urge them to remove the outdated dependency

Problem while trying to start an ionic project

I have just installed npm and ionic following the instructions on ionic framework website and as soon as i start a new project i get these errors.
I have tried many online solutions but none seem to work.
npm WARN deprecated tslint#6.1.2: TSLint has been deprecated in favor
of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...a512-0baf1FhCp16LhN+x'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Michel\AppData\Roaming\npm-cache\_logs\2020-06-07T00_38_37_180Z-debug.log
Open Windows Powershell as admin. Then run command:
npm cache clean --force
and then install ionic again as usual:
ionic start

Resources