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 [ERR_MODULE_NOT_FOUND]: Cannot find module '.../node_modules/limiter/dist/esm/RateLimiter'

See original GitHub issue

Not sure if this is a case of “pilot error” but after upgrading this package and switching to ‘import’ from ‘require’ in my code, I’m getting the following error (when I try to run my tests with mocha):

Error [ERR_MODULE_NOT_FOUND]: Cannot find module ‘/Volumes/RAID1/projects/threeceeUtilities/node_modules/limiter/dist/esm/RateLimiter’ imported from /Volumes/RAID1/projects/threeceeUtilities/node_modules/limiter/dist/esm/index.js at finalizeResolution (internal/modules/esm/resolve.js:276:11) at moduleResolve (internal/modules/esm/resolve.js:699:10) at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11) at Loader.resolve (internal/modules/esm/loader.js:86:40) at Loader.getModuleJob (internal/modules/esm/loader.js:230:28) at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:56:40) at link (internal/modules/esm/module_job.js:55:36)

I’m importing as in the README:

import { RateLimiter } from "limiter";

I’ve added the most recent version (limiter@2.0.0) using ‘yarn add limiter’

Am I doing something wrong? Any help appreciated

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jhurlimancommented, Apr 30, 2021

I added a transform step during compilation to append .js to imports. This should be fixed now, please let me know if you run into issues. 2.0.1 has been published.

0reactions
tracycollinscommented, May 1, 2021

Works for me. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >
Improve "Cannot find module" error · Issue #26588 - GitHub
The issue here is that the error message Error: Cannot find module 'foo' isn't super helpful, because you have a look in node_modules ......
Read more >
How to resolve can't find module error in Node.js - Reactgo
To fix Cannot find module errors, install the modules properly by running a npm install command in the appropriate directory as your project's ......
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
Cannot find module nodemodule/@schematics/angular/utility ...
Fix: Cannot find module \nodemodules\@schematics\angular\utility\test.js Use these steps to resolve the problem 1.
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