使用vscode在项目里本地安装webpack进度条不动

项目场景:

在学习使用webpack时,发现在vscode当中无法使用npm install 安装相应的东西,并且没有任何错误提示,仅能看到进度条不动的情况。

问题描述:

vscode执行npm install webpack 进度条不动

PS C:\Users\尘寰\Desktop\test> npm install webpack --save-dev
[..................] / rollbackFailedOptional: verb npm-session c3a9fa7cdb4a67d4

原因分析:

国内连接npm网络速度较慢,导致很多东西都无法下载或安装。

解决方案:

使用代理registry
(1)在终端输入 npm config set registry https://registry.npm.taobao.org
(2)再次安装,能够实现相应功能。(下图为安装webpack时呈现)

在这里插入图片描述

PS C:\Users\尘寰\Desktop\test> npm config set registry https://registry.npm.taobao.org
PS C:\Users\尘寰\Desktop\test> npm install webpack --save-dev
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"12.18.4","npm":"6.14.6"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
npm WARN test@1.0.0 No description
npm WARN test@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ webpack@4.44.2
added 345 packages from 201 contributors in 13.488s

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

PS C:\Users\尘寰\Desktop\test>                               
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值