簡體   English   中英

如何修復“npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142”錯誤Windows 10?

[英]How to fix "npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142" error in Windows 10?

我正在使用 Windows 10。我想在我的系統上使用 Angular 4。 當我運行 node -v 和 npm -v 時,它會顯示版本。 但是當我執行語句 npm install -g @angular/cli 時,我給出:

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142C:\Users\VAISHU\AppData\Roaming\npm\ng -> C:\Users\VAISHU\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng

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

+ @angular/cli@9.1.9
updated 1 package in 15.317s

當我輸入命令 ng -v 時,它顯示:

Available Commands:
  add Adds support for an external library to your project.
  analytics Configures the gathering of Angular CLI usage metrics. See https://angular.io/cli/usage-analytics-gathering.
  build (b) Compiles an Angular app into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.
  deploy Invokes the deploy builder for a specified project or for the default project in the workspace.
  config Retrieves or sets Angular configuration values in the angular.json file for the workspace.
  doc (d) Opens the official Angular documentation (angular.io) in a browser, and searches for a given keyword.
  e2e (e) Builds and serves an Angular app, then runs end-to-end tests using Protractor.
  generate (g) Generates and/or modifies files based on a schematic.
  help Lists available commands and their short descriptions.
  lint (l) Runs linting tools on Angular app code in a given project folder.
  new (n) Creates a new workspace and an initial Angular app.
  run Runs an Architect target with an optional custom builder configuration defined in your project.
  serve (s) Builds and serves your app, rebuilding on file changes.
  test (t) Runs unit tests in a project.
  update Updates your application and its dependencies. See https://update.angular.io/
  version (v) Outputs Angular CLI version.
  xi18n (i18n-extract) Extracts i18n messages from source code.

For more detailed help run "ng [command name] --help"

不知道要不要卸載Node js,重新安裝。 請提出任何解決方案。 謝謝你。

我在 Ubuntu 20.04 上安裝節點 unirest 模塊時收到相同的消息,但是當我第二次運行該命令時,不再顯示警告。

第一次警告:

user@server:~/project$ npm install -S unirest
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

added 55 packages, and audited 57 packages in 2s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

第二次沒有警告:

user@server:~/project$ npm install -S unirest

up to date, audited 59 packages in 617ms

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

在我的情況下,我試圖安裝 angular 使用: nmp install -g @angular/cli

我需要使用 sudo 安裝它: sudo npm install -g @angular/cli

拋出了相同的問題“貶低警告”,但最終被忽略,其他命令成功執行。

moses@dev:~/Projects/prod_qa/project_ui$ sudo npm install -g @angular/cli
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
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.
/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng

> @angular/cli@12.2.10 postinstall /usr/local/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js

? Would you like to share anonymous usage data with the Angular Team at Google under
Google’s Privacy Policy at https://policies.google.com/privacy? For more details and
how to change this setting, see https://angular.io/analytics. (y/N) 

我的安裝成功了。

為了檢查這一點,我使用了“ng version”命令而不是使用“ng -v”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM