Closed captbaritone closed 1 year ago
Seems like it is npm cache issue.
For some reason, it used old Browserslist. Sorry, I have no idea how to fix it. Let’s just use npx update-browserslist-db@latest
instead since it works.
I also recommend update browserslist
in the project.
@ai I'm confused as to how it could be an npm cache issue if it repros on a fresh clone.
Is the core issue that the update message that I'm getting from my build tool is now out of date?
There is no anymore update-db.js
script in browserslist
npm package https://github.com/browserslist/browserslist
TypeError: Cannot read properties of undefined (reading 'replace')
at /Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/update-db.js:155:22
Also, note that npm
took browserslist
from @babel/core
and didn’t install fresh version to local npm cache.
I see, so npx seems to be ignoring the @latest version, specifier, and is instead using an outdated version that it found locally.
Should I be reporting this as a bug to npm/npx then?
If you are using the latest version, yes, we can try (I am not sure that we will be lucky with any solution soon)
When I build my app I get prompted (several times) to run
npx browserslist@latest --update-db
. However, when I do I get an errorTypeError: Cannot read properties of undefined (reading 'replace')
Steps to reproduce
Actual outcome
Versions
Observation
I was prompted to report this issue here via this tweet but in filing this issue I realized that the command I was prompted to run
npx browserslist@latest --update-db
is different than the on in this repository's readme, which is:npx update-browserslist-db@latest
.If I run
npx update-browserslist-db@latest
I get a better outcome (full output of that can be found in this gist)