简体   繁体   English

错误:找不到模块“rxjs” - 创建 React 应用程序

[英]Error: Cannot find module 'rxjs' - Create React App

I am using node version 12.18.3 and create-react-app@3.4.1.我正在使用节点版本 12.18.3 和 create-react-app@3.4.1。 When I create an app with npx command, npx create-react-app test-app , I face the following issue and the app is not getting generated,当我使用 npx 命令创建应用程序npx create-react-app test-app ,我面临以下问题并且应用程序未生成,

Error: Cannot find module 'rxjs'
Require stack:
- /Users/arun/Desktop/my-work/test-app/node_modules/inquirer/lib/ui/prompt.js
- /Users/arun/Desktop/my-work/test-app/node_modules/inquirer/lib/inquirer.js
- /Users/arun/Desktop/my-work/test-app/node_modules/react-dev-utils/browsersHelper.js
- /Users/arun/Desktop/my-work/test-app/node_modules/react-scripts/scripts/init.js
- /Users/arun/Desktop/my-work/test-app/[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/arun/Desktop/my-work/test-app/node_modules/inquirer/lib/ui/prompt.js:3:34)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/arun/Desktop/my-work/test-app/node_modules/inquirer/lib/ui/prompt.js',
    '/Users/arun/Desktop/my-work/test-app/node_modules/inquirer/lib/inquirer.js',
    '/Users/arun/Desktop/my-work/test-app/node_modules/react-dev-utils/browsersHelper.js',
    '/Users/arun/Desktop/my-work/test-app/node_modules/react-scripts/scripts/init.js',
    '/Users/arun/Desktop/my-work/test-app/[eval]'
  ]
}

This is caused by having moduleResolution set to anything other than node, or having skipLibCheck set to false in the tsconfig file.这是由于在 tsconfig 文件中将 moduleResolution 设置为 node 以外的任何内容,或将 skipLibCheck 设置为 false 引起的。 Ensure these two things are corrected and the error will go away.确保这两件事得到纠正,错误就会消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Create-react-app返回“无法找到模块&#39;rxjs&#39;” - Create-react-app returns “Cannot find module 'rxjs'” 创建反应应用程序错误找不到模块'./node' - create react app error Cannot find module './node' npm 错误:通过 CLI 构建创建反应应用程序时找不到模块'.../immer.js' - npm error: Cannot find module '.../immer.js' when building a create react app through CLI create-react-app npm start错误:找不到模块&#39;@ webassemblyjs / ast&#39; - create-react-app npm start Error: Cannot find module '@webassemblyjs/ast' "Create React App 入门 - “找不到模块”" - Getting started with Create React App - "Cannot find module" 使用 Moment JS 创建 React-App:找不到模块“./locale” - Create-React-App with Moment JS: Cannot find module “./locale” create-react-app 返回错误:执行时找不到模块“react-scripts/scripts/init.js” - create-react-app returns an Error: Cannot find module 'react-scripts/scripts/init.js' when executed create-react-app 后无法启动项目:错误:找不到模块“C:\Users\pcname\Documents\react-scripts\bin\react-scripts.js” - Unable to start project after create-react-app: Error: Cannot find module 'C:\Users\pcname\Documents\react-scripts\bin\react-scripts.js' 错误:找不到模块“/app/react-web/react-scripts” - Error: Cannot find module '/app/react-web/react-scripts' 反应错误:找不到模块'./common' - React Error: Cannot find module './common'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM