-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade from date-fns 2.30 to 3.0.6: Cannot find module 'date-fns/format/index.js' from 'node_modules/date-fns-tz/format/index.js' #266
Comments
Duplicate of #260 |
Somebody has tried to fix it here: and there is a PR to upgrade to v3 of date-fns which will probably be released soon. But yeah, ultimately this package is now broken since 18th Dec when v3 came out. Your options are:
|
The package isn't broken. It's just not compatible with v3. The first sentence of the repo clearly states in the readme (which hasn't been updated since last year): 'Time zone support for date-fns v2.0.0'. The package continues to function properly with the version of date-fns is was built for. |
The problem is that npm reads dependencies from the package.json file, not from the README. Try to install this package in a fresh project and you will see it installs date-fns v3 instead of v2 because it thinks it supports it. There are already 2 PRs for this. 1 has been approved, but v2.0.0 is still the latest published version on npm. Not sure on the timelines |
To work around dependency issues, here's how you can adjust your For npmFix the version of {
...
"overrides": {
"date-fns": "2.x"
}
} For yarnInstall {
...
"dependencies": {
"date-fns": "2.x"
}
} For pnpmConform to pnpm's method by fixing the {
...
"pnpm": {
"overrides": {
"date-fns": "2.x"
}
}
} |
was on
date-fns:2.30.0
date-fns-tz:2.0.0
When upgraded to date-fns: 3.0.6 from 2.30.0 (date-fns-tz stays on v2.0.0 as this is their latest), i got this:
Any suggestions other than stay on the old version pls ?
The text was updated successfully, but these errors were encountered: