Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`

前端 未结 20 2370
忘掉有多难
忘掉有多难 2020-12-08 03:31

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

Browserslist: caniuse-lite is outdated. Please run next command n

20条回答
  •  失恋的感觉
    2020-12-08 04:16

    Answer from @Alexandr Nil is safe, and was effective for me

    I am writing as a full answer because it is easy to miss his comment.

    npm --depth 20 update caniuse-lite browserslist 
    

    This is good because:

    1. There is no deletion of package-lock.json. Deleting that leaves you vulnerable to many packages getting upgraded with breaking changes.

    2. It is explicit and very limited on which things are to be updated.

    3. It avoids the very large depth of 99 or 9999 which will work on some projects and systems, but not on others. If you have limited the depth to too small a number, it will not break anything. You can increase the depth and try again, until the project compiles successfully.

提交回复
热议问题