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.

Cannot find module

See original GitHub issue

On node 14.5.0 when trying to switch to a folder with a .node-version folder the app throws the following error: Fatal Error: Cannot find module '/Users/verpixelt/.avn/plugins/avn-nvm' Details

  • avn avn 0.2.4
  • node node 14.5.0
  • n n 6.5.1
  • zsh zsh 5.7.1

The output of __avn_debug in the directory with a .node-version file is:

Fatal Error: Cannot find module '/Users/verpixelt/.avn/plugins/avn-nvm'.
Require stack:
- /Users/verpixelt/.avn/lib/plugins.js
- /Users/verpixelt/.avn/lib/hooks.js
- /Users/verpixelt/.avn/lib/avn.js
- /Users/verpixelt/.avn/index.js
- /Users/verpixelt/.avn/bin/_avn

avn is loaded in my ~/.{bash|zsh}{_profile|rc} file with:

`[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

27reactions
konstantintiebercommented, Jan 15, 2021

I ran into the same issue when updating from node 10.13.0 to 14.15.1 using nvm

~ $ cd dev/web-pathfinder
Fatal Error: Cannot find module '/Users/konstantintieber/.avn/plugins/avn-n'
Require stack:
- /Users/konstantintieber/.avn/lib/plugins.js
- /Users/konstantintieber/.avn/lib/hooks.js
- /Users/konstantintieber/.avn/lib/avn.js
- /Users/konstantintieber/.avn/index.js
- /Users/konstantintieber/.avn/bin/_avn

Fixed it as suggested by @wbyoung with:

rm -R ~/.avn
nvm exec 10.13.0 npm install -g avn avn-nvm avn-n
nvm exec 10.13.0 avn setup

EDIT: if you do not have the node 10 version installed yet, you have to run nvm install 10.13.0 before executing the commands above

12reactions
verpixeltcommented, Jul 20, 2020

This is what happens during setup:

avn setup
avn: profile setup complete (~/.zshrc)
avn: restart your terminal to start using avn
/usr/local/lib/node_modules/avn/node_modules/npm/node_modules/graceful-fs/polyfills.js:267
      if (cb) cb.apply(this, arguments)
                 ^

TypeError: cb.apply is not a function
    at /usr/local/lib/node_modules/avn/node_modules/npm/node_modules/graceful-fs/polyfills.js:267:18
    at FSReqCallback.oncomplete (fs.js:177:5)
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve "Cannot find module" error using Node.js?
This happens when a first npm install has crashed for some reason (SIGINT of npm), or that the delay was too long, or...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
When you get the “cannot find module” error, or “module not found”, it means you've not installed the package you're trying to use....
Read more >
How to resolve "Cannot find module" error in Node - Sabe.io
The Cannot find module error is a common error that usually happens when dependencies are not installed. Once you install your dependencies and ......
Read more >
Cannot find module 'X' error in Node.js | bobbyhadz
To solve the "Cannot find module" error in Node.js, make sure to install the package from the error message if it's a third-party...
Read more >
Fixing The "Cannot Find Module" Error In TypeScript
As you can see, solving the "cannot find module" error in TypeScript is simple. If it is a new dependency, it is usually...
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