'react-scripts' is not recognized as an internal or external command

前端 未结 18 2356
清歌不尽
清歌不尽 2020-11-30 00:21

I\'ve got a maven project, within which is JavaScript project cloned as a git sub-module. So the directory structure looks something like

mavenapp/src/main/jav

18条回答
  •  难免孤独
    2020-11-30 00:54

    react-scripts is not recognized as an internal or external command is related to npm.

    I would update all of my dependencies in my package.json files to the latest versions in both the main directory and client directory if applicable. You can do this by using an asterisk "*" instead of specifying a specific version number in your package.json files for your dependencies.

    For Example:

    "dependencies": {
        "body-parser": "*",
        "express": "*",
        "mongoose": "*",
        "react": "*",
        "react-dom": "*",
        "react-final-form": "*",
        "react-final-form-listeners": "*",
        "react-mapbox-gl": "*",
        "react-redux": "*",
        "react-responsive-modal": "*",
      }
    

    I would then make sure any package-lock.json were deleted and then run npm install and yarn install in both the main directory and the client directory as well if applicable.

    You should then be able to run a yarn build and then use yarn start to run the application.

提交回复
热议问题