Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Switching from node v16.5.0 causes error Fatal Error: Cannot find module '/Users/apple/.avn/plugins/avn-nvm' #108

Open
Olgagr opened this issue Jul 30, 2021 · 3 comments

Comments

@Olgagr
Copy link

Olgagr commented Jul 30, 2021

I'm using n as my node version manager. When I'm on version 16.5.0 and I go to the project with lower version eg. 6.7.0 or 10.4.1 I get an error:

Fatal Error: Cannot find module '/Users/apple/.avn/plugins/avn-nvm'

Indeed, I don't have avn-nvm plugin installed as I'm not using nvm.

Details

  • avn 0.2.4
  • node 16.5.0
  • n 6.6.0
  • bash 3.2.57(1)-release (x86_64-apple-darwin19)

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

Fatal Error: Cannot find module '/Users/apple/.avn/plugins/avn-nvm'
Require stack:
- /Users/apple/.avn/lib/plugins.js
- /Users/apple/.avn/lib/hooks.js
- /Users/apple/.avn/lib/avn.js
- /Users/apple/.avn/index.js
- /Users/apple/.avn/bin/_avn
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15)
    at Function.Module._load (node:internal/modules/cjs/loader:772:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at /Users/apple/.avn/lib/plugins.js:59:20
    at tryCatcher (/Users/apple/.avn/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/Users/apple/.avn/node_modules/bluebird/js/release/reduce.js:168:18)
    at Object.gotAccum (/Users/apple/.avn/node_modules/bluebird/js/release/reduce.js:155:25)
    at Object.tryCatcher (/Users/apple/.avn/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/apple/.avn/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/apple/.avn/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/apple/.avn/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/apple/.avn/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/Users/apple/.avn/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/apple/.avn/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/apple/.avn/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/apple/.avn/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:464:21)

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
@wbyoung
Copy link
Owner

wbyoung commented Jul 30, 2021

Looks like you need to install the plugin or update your config in ~/.avnrc to not try to load that plugin.

@Olgagr
Copy link
Author

Olgagr commented Aug 2, 2021

@wbyoung This is what I thought. However, in my ~/.avnrc I have only:

{
  "plugins": ["n"]
}

Moreover, when I'm switching from lower version of node, eg. 10.x I don't have an issue.

@wbyoung
Copy link
Owner

wbyoung commented Aug 3, 2021

I haven't worked on this in quite some time and haven't been writing code at all for a few years. So my suggestions at this point are:

  • Reinstall
  • Edit the code directly in the installed location to debug further

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants