WARN deprecated request@2.88.2: request has been deprecated, npm WARN deprecated har-validator@5.1.5

Viewed 19595

I am trying to install angular/cli using npm install -g @angular/cli and it keeps sending me warnings

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
C:\Users\amsmk\AppData\Roaming\npm\ng -> C:\Users\amsmk\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng

> @angular/cli@10.0.7 postinstall C:\Users\amsmk\AppData\Roaming\npm\node_modules\@angular\cli
> node ./bin/postinstall/script.js

+ @angular/cli@10.0.7
added 281 packages from 206 contributors in 74.68s

How can I fix this

2 Answers

Migrate your test framework from protractor to other framework (I prefer cypress) and then uninstall protractor from your project then deprecated request and har-validator will get resolved. (https://www.npmjs.com/package/protractor?activeTab=versions, https://blog.angular.io/the-state-of-end-to-end-testing-with-angular-d175f751cb9c, https://docs.cypress.io/guides/end-to-end-testing/protractor-to-cypress#Getting-Started)

Step1: Install cypress using following command

ng add @cypress/schematic

Step2: Migrate all your tests cypress

Step3: Uninstall protractor using following command

npm uninstall protractor

Then remove the node_modules and package-lock.json file

Step4: install the node_modules again with following command

npm i or npm install

Now deprecated warnings will get resolved and removed from the project

Related