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
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
add a comment |
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
add a comment |
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
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
npm package.json npm-scripts
edited Mar 7 at 4:31
kayq
asked Mar 7 at 2:46
kayqkayq
387
387
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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 runnpm installthen navigate to the Backend folder and runnpm 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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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 runnpm installthen navigate to the Backend folder and runnpm 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
add a comment |
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.
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 runnpm installthen navigate to the Backend folder and runnpm 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
add a comment |
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.
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.
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 runnpm installthen navigate to the Backend folder and runnpm 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
add a comment |
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 runnpm installthen navigate to the Backend folder and runnpm 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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