Error on "npx browserslist@latest --update-db"

3,907 views
Skip to first unread message

Thomas

unread,
Dec 14, 2021, 4:52:35 AM12/14/21
to Cloud Carbon Footprint
When I do "yarn start" I get an advice to run "npx browserslist@latest --update-db"

When I do it, the command fails with 

node:child_process:903
    throw err;
    ^

Error: Command failed: yarn info caniuse-lite --json
    at checkExecSyncError (node:child_process:826:11)
    at Object.execSync (node:child_process:900:15)
    at getLatestInfo (/data/cloud-carbon-footprint/node_modules/browserslist/update-db.js:48:20)
    at updateDB (/data/cloud-carbon-footprint/node_modules/browserslist/update-db.js:202:16)
    at Object.<anonymous> (/data/cloud-carbon-footprint/node_modules/browserslist/cli.js:40:3)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(180) [Uint8Array] [
       85, 115,  97, 103, 101,  32,  69, 114, 114, 111, 114,  58,
       32,  78, 111,  32, 112,  97,  99, 107,  97, 103, 101,  32,
      109,  97, 116,  99, 104, 101, 100,  32, 121, 111, 117, 114,
       32, 114, 101, 113, 117, 101, 115, 116,  10,  10,  36,  32,
      121,  97, 114, 110,  32, 105, 110, 102, 111,  32,  91,  45,
       65,  44,  45,  45,  97, 108, 108,  93,  32,  91,  45,  82,
       44,  45,  45, 114, 101,  99, 117, 114, 115, 105, 118, 101,
       93,  32,  91,  45,  88,  44,  45,  45, 101, 120, 116, 114,
       97,  32,  35,  48,
      ... 80 more items
    ],
    Buffer(0) [Uint8Array] []
  ],
  pid: 1462353,
  stdout: Buffer(180) [Uint8Array] [
     85, 115,  97, 103, 101,  32,  69, 114, 114, 111, 114,  58,
     32,  78, 111,  32, 112,  97,  99, 107,  97, 103, 101,  32,
    109,  97, 116,  99, 104, 101, 100,  32, 121, 111, 117, 114,
     32, 114, 101, 113, 117, 101, 115, 116,  10,  10,  36,  32,
    121,  97, 114, 110,  32, 105, 110, 102, 111,  32,  91,  45,
     65,  44,  45,  45,  97, 108, 108,  93,  32,  91,  45,  82,
     44,  45,  45, 114, 101,  99, 117, 114, 115, 105, 118, 101,
     93,  32,  91,  45,  88,  44,  45,  45, 101, 120, 116, 114,
     97,  32,  35,  48,
    ... 80 more items
  ],
  stderr: Buffer(0) [Uint8Array] []
}

Node.js v17.2.0

I installed caniuse-lite with "yarn add caniuse-lite" or by adding it to package.json but in this case I get

TypeError: Cannot read properties of undefined (reading 'version')

Is this a known behavior? 
I still have this problem with the ApexCharts and thought it is best the clear in a first step this question.

Thomas

Thomas

unread,
Dec 14, 2021, 6:22:51 AM12/14/21
to Cloud Carbon Footprint
I have yarn 2.4.2 installed not yarn 1.xxx . Could this be a problem?

Thomas

Thomas

unread,
Dec 14, 2021, 8:48:06 AM12/14/21
to Cloud Carbon Footprint
Pulled latest version of cloud carbon footprint with yarn in version 3.1.1 but same problem. 

Thomas

unread,
Dec 14, 2021, 9:16:45 AM12/14/21
to Cloud Carbon Footprint

Solved it by adding "browserslist": "4.19.0", to the list of dependencies. See https://github.com/browserslist/browserslist/issues/552 .

However I still have this problem with ApexCharts. I still get this: 

TypeError: Cannot read property 'getAttribute' of null
t.value
node_modules/apexcharts/dist/apexcharts.common.js:6
3 | * (c) 2018-2021 Juned Chhipa
4 | * Released under the MIT License.
5 | */
> 6 | "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}funct
Reply all
Reply to author
Forward
0 new messages