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

前端 未结 18 2265
清歌不尽
清歌不尽 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:51

    For me, I just re-installed the react-scripts instead of react-scripts --save.

    0 讨论(0)
  • 2020-11-30 00:52

    Have you tried:

    rm -rf node_modules && npm install

    Wiping node_modules first, often tends to fix a lot of weird, package related issues like that in Node.

    0 讨论(0)
  • 2020-11-30 00:52

    This is rather old question but this might be of some help for future reference. Delete node_modules folder and run npm install again. Worked for me.

    0 讨论(0)
  • 2020-11-30 00:54

    i fix this issue :-), just uninstall your node.js and show hidden files

    then go to "C:\Users\yourpcname\AppData\Roaming\

    then delete the "npm" and "npm-cache" folder

    and install a new version of node.js.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-11-30 00:54

    had similar issue.. i used yarn to fix it. i noticed that react-scripts was not found in my node modules so i decided to download it with npm but i seem to be failing too. so i tried yarn ( yarn add react-scripts) and that solved the nightmare! Hope this work for you as well. Happy debuging folks.

    0 讨论(0)
提交回复
热议问题