0
0

React :npm ERR! cb.apply is not a function

Posted at

エラー発生:npm ERR! cb.apply is not a function

Reactの初期設定コマンドnpx create-react-app . --use-npmを実行したところ、npm ERR! cb.apply is not a functionというエラーが発生しました。

twitter_react_frontend % npx create-react-app . --use-npm

(node:67518) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/toto/.npm/_logs/2024-01-28T02_58_52_906Z-debug.log
コード[ 'create-react-app@latest' ]で1のインストールに失敗しました

対応方法

アップデートとキャッシュのクリアにより、無事成功しました。
同じエラーが発生したときに、試してみてください。

  • アップデート
twitter_react_frontend % npm install -g npm@latest

removed 25 packages, and changed 45 packages in 3s

24 packages are looking for funding
  run `npm fund` for details
  • キャッシュクリア
twitter_react_frontend % npm cache clean --force
  • 成功
twitter_react_frontend % npx create-react-app . --use-npm

Creating a new React app in /Users/toto/Desktop/twitter_react_frontend.
〜〜
We suggest that you begin by typing:

  cd /Users/toto/Desktop/twitter_react_frontend.
  npm start

You had a `README.md` file, we renamed it to `README.old.md`

Happy hacking!
0
0
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
0
0