最近使用nodejs時遇到npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
問題
最后在外網翻到可行答案,並翻譯記錄了一下。原文鏈接 侵刪
如何從Windows完全刪除node.js?
最近更新: 2021年2月23日
我們可以使用以下簡單步驟從Windows完全刪除Node.js:
步驟1:每當我們使用命令npm install
npm cache clean --force
步驟2:之后,您可以使用以下命令來驗證緩存:
npm cache verify
步驟3: 現在,打開計算機中的控制面板。搜索程序和功能。在程序和功能下,單擊“卸載程序”。現在搜索Node.js並將其卸載。
步驟4:重新啟動計算機,或從任務管理器中終止所有與節點有關的進程。
步驟5:在您的計算機中查找文件夾,如果存在,請將其刪除。這些文件夾可能會或可能不會存在於您的計算機中,具體取決於各種因素,例如安裝的版本或CPU體系結構。
- C:\ Program Files(x86)\ Nodejs
- C:\ Program Files \ Nodejs
- C:\ Users \ {User} \ AppData \ Roaming \ npm或打開運行並鍵入appdata,然后單擊“確定”並在其中打開漫游,您將找到npm。
- C:\ Users \ {User} \ AppData \ Roaming \ npm-cache或打開運行並鍵入appdata,然后單擊“確定”並在其中打開漫游,您將找到npm-cache。
- C:\ Users \ {User} \。npmrc
- C:\ Users \ {User} \ AppData \ Local \ Temp \ npm- *
步驟6:之后,檢查環境路徑變量,並確保不存在對npm或Node.js的引用。
步驟7:如果仍未卸載Node.js,則打開命令提示符並鍵入以下命令:
where node
步驟8:如果未卸載Node.js,該命令將輸出Node.js的位置。轉到該位置並卸載目錄。
步驟9:重新啟動計算機。現在已完全卸載Node.js。
補充:不行的話再試試下面的
Open your command prompt and uninstall angular/cli by using
npm uninstall -g angular-cli
command.
Remove node_modules directory and then clear the cache by using
npm cache clear --force
command.
Remove
C:\Users
you can remove the folder this way
rmdir C:\Users<username>\AppData\Roaming\npm\ /s
and
C:\Users
you can remove the folder this way
rmdir C:\Users<username>\AppData\Roaming\npm-cache /s
Now try to install the angular/cli@latest by using npm install -g @angular/cli@latest
command.