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.

Error: Cannot find module 'date-fns/isValid'

See original GitHub issue

Hello guys

Using node 8.x and 10.x I have this error

Error: Cannot find module 'date-fns/isValid'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/MyProject/node_modules/validatorjs/src/rules.js:1:77)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Please check https://www.npmjs.com/package/date-fns

Actually, I solved the problem using @date-fns/upgrade in my project.

npm install @date-fns/upgrade --save

Thanks a lot 👍

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
mikeericksoncommented, Nov 27, 2019

Sorry for delay on this, I will get this cured ASAP and post a fix. Not sure where the regression occurred, but I will remedy it. In the meantime, installing date-fns manually will cure

1reaction
mikeericksoncommented, Nov 27, 2019

I have patched the 3.18 release (verison 3.18.1) which fixes this regression.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'date-fns' - Stack Overflow
Try using this instead First import the modules. In the terminal type npm install date-fns @types/date-fns. Then in code
Read more >
Cannot find module 'date-fns' error | bobbyhadz
To solve the error "Cannot find module 'date-fns'", make sure to install the date-fns package by opening your terminal in your project's root...
Read more >
Error: Cannot find module 'date-fns/isValid' · Issue #350 - GitHub
Hello guys Using node 8.x and 10.x I have this error Error: Cannot find module 'date-fns/isValid' at Function.Module.
Read more >
Cannot find module 'date-fns' error [Solved] - Reactgo
To solve the can't find module date-fns error, install the date-fns module in your project directory by running the npm install date-fns command ......
Read more >
date-fns - npm
date -fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
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