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

Error loading plugins in node v12, prevents activation of correct node #95

Open
1 task done
percyhanna opened this issue Feb 13, 2020 · 2 comments
Open
1 task done

Comments

@percyhanna
Copy link
Contributor

I believe this is a bug in avn, but I'm not 100% certain.

It seems that Node v12 (or some other version) has changed the message format for the require exception message, such that this regex no longer works.

If the current version of Node is v12, the plugin loading code fails to run properly. If I switch to an older version, e.g. nvm use 8 and then try to cd into the directory, it works fine.

I will open a PR for a potential fix.

Details

  • avn 0.2.4
  • node v12.14.1
  • nvm 0.35.2
  • bash 3.2.57(1)

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

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

avn is loaded in my ~/.bash_profile} file with:

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

nvm specific

  • As an nvm user I am confirming that I did not install with Homebrew
@percyhanna
Copy link
Contributor Author

I didn't see anything that implied some local configuration or customization would have changed the exception message, but that is conceivable.

@alpe88
Copy link

alpe88 commented Jul 27, 2020

This is tied to #105 - there's also more information there. I am also experiencing this issue. Seems the first step is to update the polyfil dependency. This dependency is tied to npm I think. There's also a failed merge from dependabot from 20 days ago that tried updating npm.

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