本文介绍了浏览器列表:caniuse-lite已过时。请运行下一个命令`npm update caniuse-lite browserslist`。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,当我编译我的scss文件时,出现错误。错误消息显示:

Recently, when I compile my scss files I get an error. The error message says:

首先,作为消息说,我运行了 npm更新caniuse-lite浏览器列表,但它没有解决问题。
我删除了整个nod-modules目录并再次安装,我也通过 npm update 更新了整个文件夹,但没有一个解决了问题。
我还重新安装了autoprefixer和browserslist,但没有一个解决了这个问题。

First, as the message says, I ran npm update caniuse-lite browserslist but it didn't fix the issue.I deleted the whole nod-modules directory and installed again, also I updated the whole folder by npm update but none of them solved the issue.I also reinstalled autoprefixer and browserslist but none of them solved the issue.

如果我删除了

"options": {
      "autoPrefix": "> 1%"
    }

来自我的 compilerconfig.json ,一切正常,这可能与自动前缀相关。另外,我在 package.json 上手动将软件包版本更改为最新版本,然后重新安装,但没有运气。

from my compilerconfig.json, everything works fine which means probably it is related to autoprefixer. Also, I manually changed the package version to the latest version on package.json and reinstalled but no luck.

推荐答案

听起来您正在使用Visual Studio的Web编译器扩展。此处存在一个未解决的问题:

It sounds like you are using Visual Studio's Web Compiler extension. There is an open issue for this found here: https://github.com/madskristensen/WebCompiler/issues/413

该问题中发布了一种解决方法:

There is a workaround posted in that issue:


  1. 关闭Visual Studio

  2. 前往 C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.XX (X是WebCompiler的版本)

  3. node_modules 文件夹中删除以下文件夹: caniuse-精简版浏览器列表
    打开CMD(在 C:\Users\USERNAME\AppData\内\Local\Temp\WebCompilerX.XX )并运行: npm i caniuse-lite browserslist

  1. Close Visual Studio
  2. Head to C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X (X is the version of WebCompiler)
  3. Delete following folders from node_modules folder: caniuse-lite and browserslistOpen up CMD (inside C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X) and run: npm i caniuse-lite browserslist

这篇关于浏览器列表:caniuse-lite已过时。请运行下一个命令`npm update caniuse-lite browserslist`。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 07:56