npm 安装错误 & npm WARN 已弃用

Thi*_*Six 2 node.js gulp

无法安装 Node.js 11.15.0 中的 gulp。我也尝试过 10.x 版本,它抛出了同样的错误。

$ npm install -g gulp-cli
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

changed 265 packages, and audited 266 packages in 57s

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

3 low severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
Run Code Online (Sandbox Code Playgroud)

谁能帮我安装 gulp 吗?

我尝试删除node_modules目录,然后使用命令清除缓存 "npm cache clear --force"。但没有运气。

另外,当我运行 npm install 时遇到问题

$ npm install
npm ERR! code 1
npm ERR! path C:\..........\node_modules\node-sass
npm ERR! command failed
....
npm ERR! gyp ERR! node -v v11.15.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
Run Code Online (Sandbox Code Playgroud)

Thi*_*Six 5

最后我得到了它。 npm install在我的 Windows 系统中工作正常。

删除node_modules目录和package-lock.json,然后使用此命令清除缓存

npm cache clear --force
Run Code Online (Sandbox Code Playgroud)

我删除了 npm 和 npm-cache 文件夹 C:\Users\USERNAME\AppData\Roaming\npmC:\Users\USERNAME\AppData\Roaming\npm-cache

然后我尝试安装 npm

npm install
Run Code Online (Sandbox Code Playgroud)

我希望这对某人有帮助。