REACT Error: Cannot find module 'core-util-is'

REACT Error: Cannot find module 'core-util-is'

我一直在创建 React 应用程序。 我已经尝试过 npx create-react-app 我的应用程序,但它不起作用。现在我得到这个“找不到模块 'core-utils-is',之前我修复了另一个模块的另一个问题。所以,我怀疑我有一个错误。 我认为最好的解决方案是从 cero 开始。但是我不确定如何在不破坏所有(nodejs,npm ...)的情况下卸载并重新安装我需要的所有东西。 我附上我的控制台的图像: enter image description here

$ npx create-react-app my-app internal/modules/cjs/loader.js:883
throw err; ^

Error: Cannot find module 'core-util-is' Require stack:

  • C:\Users\ILC\node_modules\hyperquest\node_modules\readable-stream\lib_stream_duplex.js
  • C:\Users\ILC\node_modules\hyperquest\node_modules\readable-stream\lib_stream_transform.js
  • C:\Users\ILC\node_modules\hyperquest\node_modules\readable-stream\transform.js
  • C:\Users\ILC\node_modules\hyperquest\node_modules\through2\through2.js
  • C:\Users\ILC\node_modules\hyperquest\index.js
  • C:\Users\ILC\node_modules\create-react-app\createReactApp.js
  • C:\Users\ILC\node_modules\create-react-app\index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (C:\Users\ILC\node_modules\hyperquest\node_modules\readable-stream\lib_stream_duplex.js:39:12) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\ILC\node_modules\hyperquest\node_modules\readable-stream\lib\_stream_duplex.js', 'C:\Users\ILC\node_modules\hyperquest\node_modules\readable-stream\lib\_stream_transform.js', 'C:\Users\ILC\node_modules\hyperquest\node_modules\readable-stream\transform.js', 'C:\Users\ILC\node_modules\hyperquest\node_modules\through2\through2.js', 'C:\Users\ILC\node_modules\hyperquest\index.js', 'C:\Users\ILC\node_modules\create-react-app\createReactApp.js', 'C:\Users\ILC\node_modules\create-react-app\index.js' ] } Thank you

您可以尝试使用 npm update 更新 npm,看看是否可以解决问题,如果不能,您可以尝试这些步骤。

如果您之前通过 npm install -g create-react-app 全局安装了 create-react-app,建议您使用 npm uninstall -g create-react-appyarn global remove create-react-app 卸载软件包以确保 npx 始终使用最新版本。

您可能还想 cd 进入您要托管程序的目录。我倾向于将所有程序放入 c:\Users\<Username>\Documents\github 中的文件夹中。看起来您的 node_modules 正在尝试直接安装到您的用户主目录。

进入选择构建应用程序的目录并删除全局安装后,您可以尝试 运行 这些命令。
npx create-react-app my-app
cd my-app
npm start

Create React App - Getting Started

编辑:如果这对你有用,那么你可能还想返回 C:\Users\ILC 并删除你的 node_modules 文件夹和任何其他残余文件,例如 package.json '属于该文件夹。