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.

node module date-fns won't work

See original GitHub issue

the node module date-fns won’t work with NativeScript. This module as _lib folder which seems to be ignored by NativeScript causing a:

Failed to find module: "../_lib/toInteger/index.js", relative to: app/tns_modules/date-fns/addDays/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
farfromrefugcommented, Jul 6, 2018

@NickIliev I can confirm that it happen with 1.29.0. That version does not have a _lib directory

1reaction
farfromrefugcommented, Jul 10, 2018

@NickIliev Actually I think the sample you have is enough. Now I am seeing it randomly when running tns run android. It seems like sometimes the _lib folder is ignored. All other folders are there. Obviously as it is random you can’t really look at this. I get that. Will try to fix it myself

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use date-fns in a Node.js project? - Stack Overflow
I managed to run it successfully by using require as shown below: const fns = require('date-fns') console.log(fns.format(new Date(), ...
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 >
Cannot find module 'date-fns' error [Solved] - Reactgo
The “Cannot find module 'date-fns'” error occurs due to one of the following reasons: The module is not installed in the correct project…...
Read more >
module not found: Can't resolve 'date-fns/esm/format' #133
Well, I just tried using import { utcToZonedTime } from 'date-fns-tz'; in a project with "type": "module" with Node.js v17.3.0. I tried the ......
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