Package.json for server and client Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How to decide when to use Node.js?How do I install package.json dependencies in the current directory using npmHow do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)NPM global install “cannot find module”How do I update each dependency in package.json to the latest version?What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?What's the difference between tilde(~) and caret(^) in package.json?How do I fix the npm UNMET PEER DEPENDENCY warning?Node Sass could not find a binding for your current environmentWhy does “npm install” rewrite package-lock.json?

Is grep documentation about ignoring case wrong, since it doesn't ignore case in filenames?

Effects on objects due to a brief relocation of massive amounts of mass

How to install press fit bottom bracket into new frame

How fail-safe is nr as stop bytes?

Is it possible for SQL statements to execute concurrently within a single session in SQL Server?

Generate an RGB colour grid

Performance gap between vector<bool> and array

Significance of Cersei's obsession with elephants?

How to compare two different files line by line in unix?

Chinese Seal on silk painting - what does it mean?

Trademark violation for app?

Why do early math courses focus on the cross sections of a cone and not on other 3D objects?

Project Euler #1 in C++

How to play a character with a disability or mental disorder without being offensive?

What's the meaning of "fortified infraction restraint"?

Can a new player join a group only when a new campaign starts?

Disembodied hand growing fangs

How were pictures turned from film to a big picture in a picture frame before digital scanning?

How does the secondary effect of the Heat Metal spell interact with a creature resistant/immune to fire damage?

How to write the following sign?

Is there any word for a place full of confusion?

Sum letters are not two different

How can I reduce the gap between left and right of cdot with a macro?

Is CEO the "profession" with the most psychopaths?



Package.json for server and client



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How to decide when to use Node.js?How do I install package.json dependencies in the current directory using npmHow do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)NPM global install “cannot find module”How do I update each dependency in package.json to the latest version?What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?What's the difference between tilde(~) and caret(^) in package.json?How do I fix the npm UNMET PEER DEPENDENCY warning?Node Sass could not find a binding for your current environmentWhy does “npm install” rewrite package-lock.json?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








3















I want to install package.json for client side from my server side package.json as the server side is using node and client side is using angular 2
directory structure



server-app

--bin

--node_modules

--package.json

--client-app

--app

--node_modules

--package.json


now the problem is:



I have to run this command npm install from server app folder and also from server-app/client-app folder separately this will create deployment issues



what I want is to run only one time npm install from i.e server-app and it will automatically install the server-app package.json and client-side-app
package.json too.
Any help will be highly appreciated










share|improve this question

















  • 1





    Did you read this? docs.npmjs.com/files/package.json#local-paths

    – hisener
    Aug 28 '17 at 6:12

















3















I want to install package.json for client side from my server side package.json as the server side is using node and client side is using angular 2
directory structure



server-app

--bin

--node_modules

--package.json

--client-app

--app

--node_modules

--package.json


now the problem is:



I have to run this command npm install from server app folder and also from server-app/client-app folder separately this will create deployment issues



what I want is to run only one time npm install from i.e server-app and it will automatically install the server-app package.json and client-side-app
package.json too.
Any help will be highly appreciated










share|improve this question

















  • 1





    Did you read this? docs.npmjs.com/files/package.json#local-paths

    – hisener
    Aug 28 '17 at 6:12













3












3








3


1






I want to install package.json for client side from my server side package.json as the server side is using node and client side is using angular 2
directory structure



server-app

--bin

--node_modules

--package.json

--client-app

--app

--node_modules

--package.json


now the problem is:



I have to run this command npm install from server app folder and also from server-app/client-app folder separately this will create deployment issues



what I want is to run only one time npm install from i.e server-app and it will automatically install the server-app package.json and client-side-app
package.json too.
Any help will be highly appreciated










share|improve this question














I want to install package.json for client side from my server side package.json as the server side is using node and client side is using angular 2
directory structure



server-app

--bin

--node_modules

--package.json

--client-app

--app

--node_modules

--package.json


now the problem is:



I have to run this command npm install from server app folder and also from server-app/client-app folder separately this will create deployment issues



what I want is to run only one time npm install from i.e server-app and it will automatically install the server-app package.json and client-side-app
package.json too.
Any help will be highly appreciated







node.js angular npm npm-install node-modules






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 28 '17 at 6:09









Kumail HussainKumail Hussain

380627




380627







  • 1





    Did you read this? docs.npmjs.com/files/package.json#local-paths

    – hisener
    Aug 28 '17 at 6:12












  • 1





    Did you read this? docs.npmjs.com/files/package.json#local-paths

    – hisener
    Aug 28 '17 at 6:12







1




1





Did you read this? docs.npmjs.com/files/package.json#local-paths

– hisener
Aug 28 '17 at 6:12





Did you read this? docs.npmjs.com/files/package.json#local-paths

– hisener
Aug 28 '17 at 6:12












2 Answers
2






active

oldest

votes


















2














Structure your application in the following way,



app
--server-app
--client-app
--node_modules
--package.json


This way you can have single package.json file






share|improve this answer























  • I know it but angular2 create problems while doing this it couldn't route back

    – Kumail Hussain
    Aug 28 '17 at 7:07











  • Did u tried the structure using any generators like MEAN Generator

    – Bharathvaj Ganesan
    Aug 28 '17 at 7:10











  • yeah its for angular 1

    – Kumail Hussain
    Aug 28 '17 at 7:15











  • can u post the github link of that generator

    – Bharathvaj Ganesan
    Aug 28 '17 at 7:17











  • github.com/noaman-ilyas/angular2-NodeJS-Express-SingleServer

    – Kumail Hussain
    Aug 28 '17 at 7:26


















1














I think what you need is a npm module called concurrently.



With concurrently installed in your root folder you can run multiple custom npm scripts.
For example: you can create 2 separate scripts that are installing the dependencies (client-install and server-install) and then create install-all-deps script that will run both scripts one after another and install all deps in both directories.




"scripts":
"client-install" : "cd client && npm install",
"server-install" : "cd server && npm install",
"install-all-deps": "concurrently "npm run server-install" "npm run client-install""




Here is the npm module https://www.npmjs.com/package/concurrently. Quoting doc:




Run multiple commands concurrently. Like npm run watch-js & npm run
watch-less but better.




Hope this helps.






share|improve this answer

























    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%2f45912655%2fpackage-json-for-server-and-client%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Structure your application in the following way,



    app
    --server-app
    --client-app
    --node_modules
    --package.json


    This way you can have single package.json file






    share|improve this answer























    • I know it but angular2 create problems while doing this it couldn't route back

      – Kumail Hussain
      Aug 28 '17 at 7:07











    • Did u tried the structure using any generators like MEAN Generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:10











    • yeah its for angular 1

      – Kumail Hussain
      Aug 28 '17 at 7:15











    • can u post the github link of that generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:17











    • github.com/noaman-ilyas/angular2-NodeJS-Express-SingleServer

      – Kumail Hussain
      Aug 28 '17 at 7:26















    2














    Structure your application in the following way,



    app
    --server-app
    --client-app
    --node_modules
    --package.json


    This way you can have single package.json file






    share|improve this answer























    • I know it but angular2 create problems while doing this it couldn't route back

      – Kumail Hussain
      Aug 28 '17 at 7:07











    • Did u tried the structure using any generators like MEAN Generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:10











    • yeah its for angular 1

      – Kumail Hussain
      Aug 28 '17 at 7:15











    • can u post the github link of that generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:17











    • github.com/noaman-ilyas/angular2-NodeJS-Express-SingleServer

      – Kumail Hussain
      Aug 28 '17 at 7:26













    2












    2








    2







    Structure your application in the following way,



    app
    --server-app
    --client-app
    --node_modules
    --package.json


    This way you can have single package.json file






    share|improve this answer













    Structure your application in the following way,



    app
    --server-app
    --client-app
    --node_modules
    --package.json


    This way you can have single package.json file







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Aug 28 '17 at 6:19









    Bharathvaj GanesanBharathvaj Ganesan

    1,6741921




    1,6741921












    • I know it but angular2 create problems while doing this it couldn't route back

      – Kumail Hussain
      Aug 28 '17 at 7:07











    • Did u tried the structure using any generators like MEAN Generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:10











    • yeah its for angular 1

      – Kumail Hussain
      Aug 28 '17 at 7:15











    • can u post the github link of that generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:17











    • github.com/noaman-ilyas/angular2-NodeJS-Express-SingleServer

      – Kumail Hussain
      Aug 28 '17 at 7:26

















    • I know it but angular2 create problems while doing this it couldn't route back

      – Kumail Hussain
      Aug 28 '17 at 7:07











    • Did u tried the structure using any generators like MEAN Generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:10











    • yeah its for angular 1

      – Kumail Hussain
      Aug 28 '17 at 7:15











    • can u post the github link of that generator

      – Bharathvaj Ganesan
      Aug 28 '17 at 7:17











    • github.com/noaman-ilyas/angular2-NodeJS-Express-SingleServer

      – Kumail Hussain
      Aug 28 '17 at 7:26
















    I know it but angular2 create problems while doing this it couldn't route back

    – Kumail Hussain
    Aug 28 '17 at 7:07





    I know it but angular2 create problems while doing this it couldn't route back

    – Kumail Hussain
    Aug 28 '17 at 7:07













    Did u tried the structure using any generators like MEAN Generator

    – Bharathvaj Ganesan
    Aug 28 '17 at 7:10





    Did u tried the structure using any generators like MEAN Generator

    – Bharathvaj Ganesan
    Aug 28 '17 at 7:10













    yeah its for angular 1

    – Kumail Hussain
    Aug 28 '17 at 7:15





    yeah its for angular 1

    – Kumail Hussain
    Aug 28 '17 at 7:15













    can u post the github link of that generator

    – Bharathvaj Ganesan
    Aug 28 '17 at 7:17





    can u post the github link of that generator

    – Bharathvaj Ganesan
    Aug 28 '17 at 7:17













    github.com/noaman-ilyas/angular2-NodeJS-Express-SingleServer

    – Kumail Hussain
    Aug 28 '17 at 7:26





    github.com/noaman-ilyas/angular2-NodeJS-Express-SingleServer

    – Kumail Hussain
    Aug 28 '17 at 7:26













    1














    I think what you need is a npm module called concurrently.



    With concurrently installed in your root folder you can run multiple custom npm scripts.
    For example: you can create 2 separate scripts that are installing the dependencies (client-install and server-install) and then create install-all-deps script that will run both scripts one after another and install all deps in both directories.




    "scripts":
    "client-install" : "cd client && npm install",
    "server-install" : "cd server && npm install",
    "install-all-deps": "concurrently "npm run server-install" "npm run client-install""




    Here is the npm module https://www.npmjs.com/package/concurrently. Quoting doc:




    Run multiple commands concurrently. Like npm run watch-js & npm run
    watch-less but better.




    Hope this helps.






    share|improve this answer





























      1














      I think what you need is a npm module called concurrently.



      With concurrently installed in your root folder you can run multiple custom npm scripts.
      For example: you can create 2 separate scripts that are installing the dependencies (client-install and server-install) and then create install-all-deps script that will run both scripts one after another and install all deps in both directories.




      "scripts":
      "client-install" : "cd client && npm install",
      "server-install" : "cd server && npm install",
      "install-all-deps": "concurrently "npm run server-install" "npm run client-install""




      Here is the npm module https://www.npmjs.com/package/concurrently. Quoting doc:




      Run multiple commands concurrently. Like npm run watch-js & npm run
      watch-less but better.




      Hope this helps.






      share|improve this answer



























        1












        1








        1







        I think what you need is a npm module called concurrently.



        With concurrently installed in your root folder you can run multiple custom npm scripts.
        For example: you can create 2 separate scripts that are installing the dependencies (client-install and server-install) and then create install-all-deps script that will run both scripts one after another and install all deps in both directories.




        "scripts":
        "client-install" : "cd client && npm install",
        "server-install" : "cd server && npm install",
        "install-all-deps": "concurrently "npm run server-install" "npm run client-install""




        Here is the npm module https://www.npmjs.com/package/concurrently. Quoting doc:




        Run multiple commands concurrently. Like npm run watch-js & npm run
        watch-less but better.




        Hope this helps.






        share|improve this answer















        I think what you need is a npm module called concurrently.



        With concurrently installed in your root folder you can run multiple custom npm scripts.
        For example: you can create 2 separate scripts that are installing the dependencies (client-install and server-install) and then create install-all-deps script that will run both scripts one after another and install all deps in both directories.




        "scripts":
        "client-install" : "cd client && npm install",
        "server-install" : "cd server && npm install",
        "install-all-deps": "concurrently "npm run server-install" "npm run client-install""




        Here is the npm module https://www.npmjs.com/package/concurrently. Quoting doc:




        Run multiple commands concurrently. Like npm run watch-js & npm run
        watch-less but better.




        Hope this helps.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 9 at 1:49









        LoneWanderer

        1,235925




        1,235925










        answered Mar 8 at 20:44









        Nikola JovanovicNikola Jovanovic

        112




        112



























            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%2f45912655%2fpackage-json-for-server-and-client%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

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved