【问题标题】:npm ERR! cb.apply is not a function (Windows)npm 错误! cb.apply 不是函数 (Windows)
【发布时间】:2022-07-02 00:49:19
【问题描述】:

我在尝试安装 React 时遇到了这个问题,谁能帮帮我?

C:\Users\MyName>npm install react --save
npm WARN npm npm does not support Node.js v16.13.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mikok\AppData\Roaming\npm-cache\_logs\2022-01-08T13_47_27_192Z-debug.log

【问题讨论】:

  • 你使用的是什么版本的 npm?应该是过时的吧?您最好使用 v7。

标签: reactjs


【解决方案1】:
  1. 卸载 NPM 并安装最新版本的 Node.js。当前版本,而不是网站上的 LTS。
  2. 转到 C:\Users\UserName\AppData\Roaming 并删除“npm”和“npm 缓存”文件夹。
  3. 在命令提示符下,运行“npm cache clean --force”。
  4. 然后根据您的喜好运行“npx create-react-app@latest your-app-name”或“npx create-next-app@latest your-app-name”。

npm 卸载 -g npm

从程序文件中卸载 Node。

【讨论】:

    猜你喜欢
    • 2020-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-08
    • 2021-06-18
    • 1970-01-01
    相关资源
    最近更新 更多