Error: Cannot find module 'commander'
See original GitHub issueWhen changing into a directory with a .node-version file I get the following error.
11:26:36 ▶ cd kibana
module.js:549
throw err;
^
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/engarcia/.avn/bin/_avn:5:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
I’ve installed avn via yarn which worked fine previously. I’ve tried blowing out avn with rm -r ~/.avn and reinstalling as well with yarn global add avn avn-nvm to no avail.
Details
- avn
avn --version- 0.2.3 - node
node --version- 8.11.1 - nvm
nvm --version- 0.33.8 - n
n --version- na - zsh
zsh --version- na - bash
bash --version- 4.4.19(1)-release
The output of __avn_debug in the directory with a .node-version file is:
11:24:48 ▶ __avn_debug
module.js:549
throw err;
^
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/engarcia/.avn/bin/_avn:5:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
avn is loaded in my ~/.bashrc file with:
[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn
nvm specific
- As an
nvmuser I am confirming that I did not install with Homebrew
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Error: Cannot find module 'commander' - node.js
Most likely commander is missing from package.json . Install it and add it to package.json by doing: npm install commander --save.
Read more >Error: Cannot find module 'commander' · Issue #688 · stedolan/jq
When I try to launch jq, it reports a missing dependency, commander. Trace: $ npm install -g jq $ jq module.js:340 throw err;...
Read more >How to solve Cannot find module 'commander' error in Node.js?
The error "Cannot find module 'commander'" occurs when you use the commander package in your code without installing it in your project. ......
Read more >Cannot find module commander in Node - rashid jorvee blog
To install the commander module you need to run the below npm install command. ... After executing the above command, the Node commander...
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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I was able to resolve this by running
npm installin~/.avn.I had a similar issue and while doing this solved the initial issue it presented a new one. I believe that using Yarn (which I used) didn’t properly install
avn-nandavn-nvmbecause they don’t include any binaries.I’ve since removed everything and globally installed
avn,avn-nandavn-nvmwithnpminstead and I had no issues so far.