nodistが.node-version
ファイルを参照したり、自分でNode.jsのカレントバージョンを変更したりすると、Node.jsとnpm
のバージョンがずれてしまうことがあります。
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\*****\AppData\Roaming\npm-cache\_logs\yyyy-mm-ddTXX_XX_XX_XXXX-debug.log
そういうときは、次のコマンドを叩くかnpmをインストールしなおしてnpm
コマンドのバージョンをNode.jsのバージョンにそろえてあげます。
nodist npm match
これで無事にnpm
コマンドが利用できるようになります。
もしこれでも改善されない場合は、npmを再インストールしてください。
そもそもnodist npm match
が実行できない場合はtaketakekahoさんのnodistでnpmとNode.jsのバージョンが合わせられずエラーとなったをご参照ください。