LoginSignup
6
5

More than 3 years have passed since last update.

cb.apply is not a function というエラーが出た時

Posted at

nodistを使ってnodeのバージョンを切り替えてると以下のようなエラーが出ます。

cb.apply is not a function

いろいろ調べるとnodistやめてピュアにインストールしろなどのものがありますが、そもそもこのエラーが出るのは単にnpmがnodeとのバージョンで不整合がおきてるからです。
なので、npmを最新にしましょう!

と思っても

npm i -g npm

とアップデート作業しても、そもそもnpm iでエラーが出るのでできません。
悲しいけど無限ループ状態。
その場合は以下のようにnodist経由でnpmのバージョンを変更すると解決します。

nodist npm 6.14.11
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5