question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot --update-db with Yarn on Windows

See original GitHub issue

It looks like the database updater is sensitive to line endings and, unfortunately for this project, Yarn on Windows has chosen to use Windows line endings:

PS REDACTED> yarn browserslist --update-db
yarn run v1.22.5
$ REDACTED\node_modules\.bin\browserslist --update-db
REDACTED\node_modules\browserslist\update-db.js:49
    if (match[1]) return match[1]
             ^

TypeError: Cannot read property '1' of null
    at getCurrentVersion (REDACTED\node_modules\browserslist\update-db.js:49:14)
    at updateDB (REDACTED\node_modules\browserslist\update-db.js:119:17)
    at Object.<anonymous> (REDACTED\node_modules\browserslist\cli.js:40:3)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
error Command failed with exit code 1.

If I re-save the yarn.lock with LF instead of CRLF, it’s fine.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

13reactions
nickretallackcommented, Sep 27, 2021

Still broken for me

node_modules/browserslist/update-db.js:49
    if (match[1]) return match[1]
             ^

TypeError: Cannot read property '1' of null
    at getCurrentVersion (node_modules/browserslist/update-db.js:49:14)
    at updateDB (node_modules/browserslist/update-db.js:119:17)
    at Object.<anonymous> (node_modules/browserslist/cli.js:40:3)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47
2reactions
emptyherecommented, Aug 3, 2022

Still broken.

Read more comments on GitHub >

github_iconTop Results From Across the Web

caniuse-lite is outdated. Please run next command `npm ...
I am using Yarn and I was able to correct this problem by removing only the caniuse-db and caniuse-lite entries in my yarn.lock...
Read more >
yarn self-update
In order to update your version of Yarn, you can run one of the following commands: npm install --global yarn - if you've...
Read more >
browserslist | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >
browserslist - npm
The config to share target browsers and Node.js versions between different front-end tools. It is used in: ... Developers set their version lists ......
Read more >
caniuse-lite is outdated. Please run: npx browserslist@latest
yarn ; yarn upgrade caniuse-lite browserlist; restart your server. If you still encounter the same issue, try clearing your browser cache.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found