我在 Windows 操作系统上的默认反应应用程序不起作用

时间:2021-03-04 15:47:17

标签: javascript reactjs react-redux

enter image description here

我是 react-redux 和编码方面的新手,我正在努力学习。

所以我做了什么:

  • 安装节点js
  • 安装 npm i -g create-react-app
  • 卸载 npm uninstall -g create-react-app
  • 安装 npx create-react-app my-app-name
  • cd my-react-app-name
  • npm 启动

我的节点版本 node -v v14.16.0

mian-react-app@0.1.0 start
react-scripts start

‘Rudex\mian-react-app\node_modules.bin’ is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module ‘C:\Users\Ali Alghanay\Documents\Projects\source\repos\react-scripts\bin\react-scripts.js’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: ‘MODULE_NOT_FOUND’,
requireStack: 

{
  "name": "mian-react-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.9",
    "@testing-library/react": "^11.2.5",
    "@testing-library/user-event": "^12.8.1",
    "bootstrap": "^4.6.0",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-redux": "^7.2.2",
    "react-router-dom": "^5.2.0",
    "react-router-redux": "^5.0.0-alpha.9",
    "react-scripts": "4.0.3",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "web-vitals": "^1.1.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

2 个答案:

答案 0 :(得分:0)

删除您的 node_modules 文件夹。 然后再次运行:

$ npm install

答案 1 :(得分:0)

好的,谢谢你们@alexrogo @ross-u,我在freecodecamp社区的kevin Smith先生的帮助下解决了这个问题。
问题出在我的仓库中,我的 ./ 充满了空格,解决方案很简单,从我的仓库中删除空格!