Npm script to run both child directory folders?How can I run multiple npm scripts in parallel?How do you prevent install of “devDependencies” NPM modules for Node.js (package.json)?Managing client side scripts with npmhow to specify local modules as npm package dependenciesNPM cannot install dependencies - Attempt to unlock something which hasn't been lockedWhy use peer dependencies in npm for plugins?Start script missing error when running npm startNode Sass could not find a binding for your current environmentUse NPM scripts to install dependancies into the relevant sub folder?Uglifyjs works from the command-line, but not from npm run script?Get directory relative to file that calls npm module

How to leave product feedback on macOS?

Should I warn a new PhD Student?

When and why was runway 07/25 at Kai Tak removed?

Would this string work as string?

How do I fix the group tension caused by my character stealing and possibly killing without provocation?

How to get directions in deep space?

Proving an identity involving cross products and coplanar vectors

Unable to disable Microsoft Store in domain environment

How much do grades matter for a future academia position?

Pre-Employment Background Check With Consent For Future Checks

Why does a 97 / 92 key piano exist by Bösendorfer?

Sigmoid with a slope but no asymptotes?

Origin of pigs as a species

Isometric embedding of a genus g surface

In One Punch Man, is King actually weak?

Why the "ls" command is showing the permissions of files in a FAT32 partition?

Check if object is null and return null

Why does the Persian emissary display a string of crowned skulls?

ContourPlot — How do I color by contour curvature?

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?

The Digit Triangles

El Dorado Word Puzzle II: Videogame Edition

How to test the sharpness of a knife?

Language involving irrational number is not a CFL



Npm script to run both child directory folders?


How can I run multiple npm scripts in parallel?How do you prevent install of “devDependencies” NPM modules for Node.js (package.json)?Managing client side scripts with npmhow to specify local modules as npm package dependenciesNPM cannot install dependencies - Attempt to unlock something which hasn't been lockedWhy use peer dependencies in npm for plugins?Start script missing error when running npm startNode Sass could not find a binding for your current environmentUse NPM scripts to install dependancies into the relevant sub folder?Uglifyjs works from the command-line, but not from npm run script?Get directory relative to file that calls npm module













0















How do I write a script in my Parent Folder's package.json file so that when I run npm install it installs the node modules in each folder and npm start will go to each folder and run npm start



The Frontend and Backend folder both use npm start to start up and I want to somehow do the same in the parent folder to simultaneously start both



This is the file structure:



ParentFolder
├── package.json . <--- npm install && npm start scripts
├── FrontEnd
│ ├── /node_modules
│ ├── package.json
│ └── index.js
├── Backend
│ ├── /node_modules
│ ├── package.json
│ ├── routes.js
│ └── server.js.js









share|improve this question




























    0















    How do I write a script in my Parent Folder's package.json file so that when I run npm install it installs the node modules in each folder and npm start will go to each folder and run npm start



    The Frontend and Backend folder both use npm start to start up and I want to somehow do the same in the parent folder to simultaneously start both



    This is the file structure:



    ParentFolder
    ├── package.json . <--- npm install && npm start scripts
    ├── FrontEnd
    │ ├── /node_modules
    │ ├── package.json
    │ └── index.js
    ├── Backend
    │ ├── /node_modules
    │ ├── package.json
    │ ├── routes.js
    │ └── server.js.js









    share|improve this question


























      0












      0








      0








      How do I write a script in my Parent Folder's package.json file so that when I run npm install it installs the node modules in each folder and npm start will go to each folder and run npm start



      The Frontend and Backend folder both use npm start to start up and I want to somehow do the same in the parent folder to simultaneously start both



      This is the file structure:



      ParentFolder
      ├── package.json . <--- npm install && npm start scripts
      ├── FrontEnd
      │ ├── /node_modules
      │ ├── package.json
      │ └── index.js
      ├── Backend
      │ ├── /node_modules
      │ ├── package.json
      │ ├── routes.js
      │ └── server.js.js









      share|improve this question
















      How do I write a script in my Parent Folder's package.json file so that when I run npm install it installs the node modules in each folder and npm start will go to each folder and run npm start



      The Frontend and Backend folder both use npm start to start up and I want to somehow do the same in the parent folder to simultaneously start both



      This is the file structure:



      ParentFolder
      ├── package.json . <--- npm install && npm start scripts
      ├── FrontEnd
      │ ├── /node_modules
      │ ├── package.json
      │ └── index.js
      ├── Backend
      │ ├── /node_modules
      │ ├── package.json
      │ ├── routes.js
      │ └── server.js.js






      npm package.json npm-scripts






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 4:31







      kayq

















      asked Mar 7 at 2:46









      kayqkayq

      387




      387






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Installing in two directories is easy with find



          find ./*/* -maxdepth 1 -name package.json -execdir npm install ;


          This looks in each directory for a package.json and executes npm install;



          npm start becomes a bit harder. At least on Windows using Cygwin, I wanted to do:



          npm --prefix ./FrontEnd start ./FrontEnd & npm --prefix ./Backend start ./Backend


          But it wasn't actually running in the background like I expected and FrontEnd was the only one that actually started. Depending on your start script this could work for you.



          Possible solutions for this could be concurrently or npm-run-all -p.






          share|improve this answer

























          • That didn't work, it just made 2 folders called Backend and Frontend in the same parent directory. Sorry if I wasn't clear but what I intended to was that the start scripts will navigate to Frontend folder and run npm install then navigate to the Backend folder and run npm install

            – kayq
            Mar 7 at 4:28











          • Ah thanks. I think I have a solution. Just running it locally to make sure it works.

            – Nathan
            Mar 7 at 4:47











          • Edited with more info

            – Nathan
            Mar 7 at 5:21










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55035269%2fnpm-script-to-run-both-child-directory-folders%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Installing in two directories is easy with find



          find ./*/* -maxdepth 1 -name package.json -execdir npm install ;


          This looks in each directory for a package.json and executes npm install;



          npm start becomes a bit harder. At least on Windows using Cygwin, I wanted to do:



          npm --prefix ./FrontEnd start ./FrontEnd & npm --prefix ./Backend start ./Backend


          But it wasn't actually running in the background like I expected and FrontEnd was the only one that actually started. Depending on your start script this could work for you.



          Possible solutions for this could be concurrently or npm-run-all -p.






          share|improve this answer

























          • That didn't work, it just made 2 folders called Backend and Frontend in the same parent directory. Sorry if I wasn't clear but what I intended to was that the start scripts will navigate to Frontend folder and run npm install then navigate to the Backend folder and run npm install

            – kayq
            Mar 7 at 4:28











          • Ah thanks. I think I have a solution. Just running it locally to make sure it works.

            – Nathan
            Mar 7 at 4:47











          • Edited with more info

            – Nathan
            Mar 7 at 5:21















          1














          Installing in two directories is easy with find



          find ./*/* -maxdepth 1 -name package.json -execdir npm install ;


          This looks in each directory for a package.json and executes npm install;



          npm start becomes a bit harder. At least on Windows using Cygwin, I wanted to do:



          npm --prefix ./FrontEnd start ./FrontEnd & npm --prefix ./Backend start ./Backend


          But it wasn't actually running in the background like I expected and FrontEnd was the only one that actually started. Depending on your start script this could work for you.



          Possible solutions for this could be concurrently or npm-run-all -p.






          share|improve this answer

























          • That didn't work, it just made 2 folders called Backend and Frontend in the same parent directory. Sorry if I wasn't clear but what I intended to was that the start scripts will navigate to Frontend folder and run npm install then navigate to the Backend folder and run npm install

            – kayq
            Mar 7 at 4:28











          • Ah thanks. I think I have a solution. Just running it locally to make sure it works.

            – Nathan
            Mar 7 at 4:47











          • Edited with more info

            – Nathan
            Mar 7 at 5:21













          1












          1








          1







          Installing in two directories is easy with find



          find ./*/* -maxdepth 1 -name package.json -execdir npm install ;


          This looks in each directory for a package.json and executes npm install;



          npm start becomes a bit harder. At least on Windows using Cygwin, I wanted to do:



          npm --prefix ./FrontEnd start ./FrontEnd & npm --prefix ./Backend start ./Backend


          But it wasn't actually running in the background like I expected and FrontEnd was the only one that actually started. Depending on your start script this could work for you.



          Possible solutions for this could be concurrently or npm-run-all -p.






          share|improve this answer















          Installing in two directories is easy with find



          find ./*/* -maxdepth 1 -name package.json -execdir npm install ;


          This looks in each directory for a package.json and executes npm install;



          npm start becomes a bit harder. At least on Windows using Cygwin, I wanted to do:



          npm --prefix ./FrontEnd start ./FrontEnd & npm --prefix ./Backend start ./Backend


          But it wasn't actually running in the background like I expected and FrontEnd was the only one that actually started. Depending on your start script this could work for you.



          Possible solutions for this could be concurrently or npm-run-all -p.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 7 at 5:21

























          answered Mar 7 at 4:16









          NathanNathan

          37213




          37213












          • That didn't work, it just made 2 folders called Backend and Frontend in the same parent directory. Sorry if I wasn't clear but what I intended to was that the start scripts will navigate to Frontend folder and run npm install then navigate to the Backend folder and run npm install

            – kayq
            Mar 7 at 4:28











          • Ah thanks. I think I have a solution. Just running it locally to make sure it works.

            – Nathan
            Mar 7 at 4:47











          • Edited with more info

            – Nathan
            Mar 7 at 5:21

















          • That didn't work, it just made 2 folders called Backend and Frontend in the same parent directory. Sorry if I wasn't clear but what I intended to was that the start scripts will navigate to Frontend folder and run npm install then navigate to the Backend folder and run npm install

            – kayq
            Mar 7 at 4:28











          • Ah thanks. I think I have a solution. Just running it locally to make sure it works.

            – Nathan
            Mar 7 at 4:47











          • Edited with more info

            – Nathan
            Mar 7 at 5:21
















          That didn't work, it just made 2 folders called Backend and Frontend in the same parent directory. Sorry if I wasn't clear but what I intended to was that the start scripts will navigate to Frontend folder and run npm install then navigate to the Backend folder and run npm install

          – kayq
          Mar 7 at 4:28





          That didn't work, it just made 2 folders called Backend and Frontend in the same parent directory. Sorry if I wasn't clear but what I intended to was that the start scripts will navigate to Frontend folder and run npm install then navigate to the Backend folder and run npm install

          – kayq
          Mar 7 at 4:28













          Ah thanks. I think I have a solution. Just running it locally to make sure it works.

          – Nathan
          Mar 7 at 4:47





          Ah thanks. I think I have a solution. Just running it locally to make sure it works.

          – Nathan
          Mar 7 at 4:47













          Edited with more info

          – Nathan
          Mar 7 at 5:21





          Edited with more info

          – Nathan
          Mar 7 at 5:21



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55035269%2fnpm-script-to-run-both-child-directory-folders%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

          Алба-Юлія

          Захаров Федір Захарович