Is it possible to simultaneously run both an npm server and a proxy in separate directories with just one command in

We are currently working on a project that involves a 'server' folder and a 'client' folder.

In order to run the project, we have to navigate to the 'server' folder, enter 'npm run nodemon' in the terminal, and then open a new Terminal tab/window, switch to the 'client' folder, and execute 'npm run proxy'.

The second command is a script specified in package.json:

"proxy": "ng serve --sourcemap --extractCss -o --hmr -e=hmr --proxy-config proxy.config.json",

So, how can I create a single script in package.json to perform both of these actions? I am familiar with running scripts in parallel, but the challenge here is having two scripts in different directories and terminals.

Answer №1

Give this script a try and inform me if it functions properly:

"scripts": {
       "proxy": "(cd ../path/to/server && npm run nodemon) && (ng serve --sourcemap --extractCss -o --hmr -e=hmr --proxy-config proxy.config.json)",    
    }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing unique layouts for specific views in sails.js and angular.js

I am currently working on a Sails.js + Angular.js project with a single layout. However, I have come across different HTML files that have a completely different layout compared to the one I am using. The layout file I am currently using is the default la ...

The cPanel Node.js application is experiencing difficulties connecting to the MongoDB Atlas cluster, yet it functions without any issues on

Having developed a website using Node.js with MongoDB Atlas as the database, I encountered no issues while testing it on Heroku. However, after purchasing my domain and switching to proper hosting, I faced challenges. I attempted to set up my website by c ...

Techniques for transmitting stringified JSON data from the view to the controller in MVC4

I am struggling to properly send a stringified JSON object when a button is clicked. Despite being able to call the necessary Action method upon button click, the parameter is passed as null. MemberLogin.cshtml <input type="button" value="» Continue" ...

Creating a dynamic nested form in AngularJS by binding data to a model

Creating a nested form from a JSON object called formObject, I bind the values within the object itself. By recursively parsing the values, I extract the actual data, referred to as dataObject, upon submission. To view the dataObject in a linear format, r ...

Converting a text file to JSON in Python with element stripping and reordering techniques

I have a file with data separated by spaces like this: 2017-05-16 00:44:36.151724381 +43.8187 -104.7669 -004.4 00.6 00.2 00.2 090 C 2017-05-16 00:44:36.246672534 +41.6321 -104.7834 +004.3 00.6 00.3 00.2 130 C 2017-05-16 00:44:36.356132768 +46.4559 -104.5 ...

Updating the `link` function to target a specific DOM element within an Angular 2 component

Angular 1 uses the link function in a directive to target DOM elements. link: function (scope, element, attr) { // do something with element[0], e.g. put generated graphics // inside the node } What is the equivalent feature in Angular 2? ...

Having issues with my npm, it's acting up

I'm encountering issues with my npm that seem to persist regardless of whether I try to install using a package.json file or simply installing a node module. Here is the error message that appears in the terminal: npm http GET https://registry.npmjs. ...

I am encountering an issue with installing Cordova and Ionic globally using the command `sudo npm install -g cordova

Hey there! I recently attempted to install ionic using a command and encountered an Errno 17 error. npm ERR! code EEXIST npm ERR! syscall symlink npm ERR! path ../lib/node_modules/ionic/bin/ionic npm ERR! dest /Users/christopherwippel/.npm-global/bin/ ...

Switching things up with Angular-ui: New controller syntax for tab navigation

I'm currently working on integrating angular-ui bootstrap tabs into a basic application and running into issues with conflicting controller definitions or scope versions. var app = angular.module('plunker', ['ui.bootstrap']); // ...

Resolving issues with setting up d3.js in the 'Creating a Custom Map' guide

Starting Mike Bostock's tutorial on creating a map, but facing some installation issues at the beginning. I am using Windows 8.1 for this. This is the specific part that's causing trouble: "To get started, you'll need the reference implemen ...

Establishing a distinct registry for a particular package within the .npmrc configuration file

Today, I encountered a new challenge that I've never faced before. I am currently in need of having private node packages published in both a private and public repository under the same @scope. The packages on npmjs.org are stable and open to the pu ...

Tips for choosing multiple files with the Ctrl key in a list item element:

We have decided to create our own browsing functionality due to the limitations of the existing HTML browse feature. While using the HTML browse, we can only select multiple files by pressing the Ctrl key, and we want to replicate this feature in our custo ...

Ways to retrieve information from a JSON response in a Slack channel and transfer it to another channel

Currently facing a challenge in extracting the response obtained from a slack channel. The script below is used to retrieve the result from the specified slack channel. payload = {'token': 'XXXXXX', 'channel': 'C0L8MGLMN ...

Is the undefined Mongoose error message appearing?

I'm currently testing my database connection using jasmine. The MongoClient object is defined, but when err returns undefined, it causes my test to fail. Does Mongoose always return undefined if there's no error? Is there an alternative method ...

Seeking assistance with formatting output for OpenCPU and igraph

Here is my adjacency array data: var g = [[10, 2], [15, 0], [18, 3], [19, 6], [20, 8.5], [25, 10], [30, 9], [35, 8], [40, 5], [45, 6], [50, 2.5]] The code I am using in OpenCPU is as follows: ocpu.call("centralization.closeness", {graph: g} ...

SelectBoxIt jquery plugin can be applied after the completion of populating options in the select element with AngularJS

Utilizing AngularJS, I am dynamically populating a select box with the code below: <select ng-model="department" ng-options="dept as dept.name for dept in departmentList" class="fancy"> <option value="">-- select an optio ...

What is the best way to include data with a file when making an HTTP POST request with AngularJS and ExpressJS?

Situation I recently added file uploading functionality to my project. The front-end code was sourced from a popular tutorial on tutorialspoint. I am using the following service to send a POST request: myApp.service('fileUpload', ['$http&ap ...

Saving intricate text in Redis

In our current project, we are experimenting with using Redis (HMSET) to store a CLOB extracted from Oracle. This CLOB essentially consists of a lengthy JSON string. Our attempt looks something like this: HMSET 279479 article_id 279479 HMSET 279479 old_art ...

Unable to add npm package at this time

Feeling a bit desperate right now. I recently implemented npm and grunt to enhance my development process, which was working smoothly until today. Suddenly, I'm unable to install npm packages and keep encountering the following error message: 0 info ...

"MongoDB's .find function functions properly in the shell environment, but encounters issues when

As a newcomer to Node Express Mongo, I decided to venture into creating my own website after following tutorials. The page I'm working on is a login page. While other people's code has worked for me, my attempt didn't go as planned. Even con ...