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

avn setup throws error TypeError: cb.apply is not a function #106

Open
wangyizhuo opened this issue Oct 17, 2020 · 6 comments
Open

avn setup throws error TypeError: cb.apply is not a function #106

wangyizhuo opened this issue Oct 17, 2020 · 6 comments

Comments

@wangyizhuo
Copy link

Please describe your issue clearly and also include all details below.

Details

  • avn avn --version 0.2.4
  • node node --version v12.19.0
  • nvm nvm --version 0.35.3
  • n n --version n/a
  • zsh zsh --version zsh 5.8 (x86_64-apple-darwin19.3.0)
  • bash bash --version n/a

Steps to reproduce

avn setup

Output

avn: profile already set up (~/.zshrc)
/Users/wyz/.nvm/versions/node/v12.19.0/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 /Users/wyz/.nvm/versions/node/v12.19.0/lib/node_modules/avn/node_modules/npm/node_modules/graceful-fs/polyfills.js:267:18

nvm specific

  • [ Y] As an nvm user I am confirming that I did not install with Homebrew
@wbyoung
Copy link
Owner

wbyoung commented Oct 18, 2020

See the discussion starting here: #105 (comment)

PR welcome.

@redtux
Copy link

redtux commented Nov 14, 2020

I can confirm this critical bug on Ubuntu 20.04.1 LTS with avn 0.2.4 and nvm 0.37.0 (latest).

nvm use default --latest-npm
Now using node v14.15.0 (npm v6.14.8)
avn setup
avn: profile already set up (~/.bash_profile)
avn: profile already set up (~/.zshrc)
/home/redtux/.nvm/versions/node/v14.15.0/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 /home/redtux/.nvm/versions/node/v14.15.0/lib/node_modules/avn/node_modules/npm/node_modules/graceful-fs/polyfills.js:267:18
    at FSReqCallback.oncomplete (fs.js:184:5)

With node v10.23.0 it works.

nvm use lts/dubnium --latest-npm
Now using node v10.23.0 (npm v6.14.8)
avn setup
avn: profile already set up (~/.zshrc)
avn: profile already set up (~/.bash_profile)
avn: configuration complete (~/.avnrc)kipping project config: /home/redtux/.npmrc. (matches userconfig)
avn-nvm: installation complete
avn-n: installation complete

PS: Not volunteering for a PR or patch, just for information. ❤️

@andfaulkner
Copy link

Any updates on this? I'm still getting this exact error now, running:

  • node.js v14.16.1
  • avn v2.4
  • macOS v10.13.5

@wbyoung
Copy link
Owner

wbyoung commented Apr 29, 2021

@andfaulkner I may have mentioned on other issues that I haven't really worked on this for quite some time. It'd actually be good to find someone interested in maintaining it. But at this point, no progress on this particular issue, but any PR would be welcome.

@diegosanz
Copy link

I'm using n and I fixed it with:

  1. cd ~/.avn
  2. n auto (this installed node v4.0)
  3. cd && rm -R ~/.avn
  4. npm install -g avn avn-nvm avn-n
  5. avn setup
  6. And now it should work

@leemm
Copy link

leemm commented Nov 3, 2023

To get it working with nvm this is what I did.

avn requires nodejs v4 to run sensibly, this is key.

  1. cd ~/
  2. nvm install 4
  3. npm install -g avn avn-nvm avn-n
  4. avn setup
  5. nvm use default
  6. cd <your project directory>

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

6 participants