Run Configuration NPM with custom working directory

Hi, 

I have a Java Spring project and I have in my resources folder an angular4 project.

If i move with the terminal to project-name/src/main/resources/web and excecute ng serve, it runs perfectly.

I want to configure a run configuration to automate this. If I add a npm run config it ends up with an error in finding node modules.

I think this error happens because of the working directory is not the project root. Does anyone had this issue?

0

working dir of npm run configuration is normally a folder package.json is located in. I have no idea what it has to do with `ng serve`

0

Ok, found the solution. 

It was caching somehow the packages and had to reinstall node modules to IDEA to get them.

This should help: https://stackoverflow.com/questions/39498978/cannot-find-module-models-config/39498979#39498979

 

Now i have a run configuration npm: command: run, scripts: start 

and in my package.json:

"scripts": {
"ng": "ng",
"start": "ng serve",...
0

请先登录再写评论。