0
votes

I have installed Jenkins on my local dev machine and I am trying to configure how to build the reactjs application by running 'npm run build' inside a Windows batch command. When I run the build, it shows that it has changed the path, ran the npm install, even though with some error, but it does not show at all that npm run build has bee executed. How can I execute that?

I am running Jenkins on Windows Server 2012 and this is the version of jenkins Jenkins war org.jenkins-ci.main:jenkins-war:2.263.1 The MIT license Jenkins cli org.jenkins-ci.main:cli:2.263.1 The MIT license

I am not sure what to tell you more. Let me know if you need more information.

enter image description here

2

2 Answers

1
votes

A quick note on debugging! Login to your jenkins machine and perform the same steps. Let us see if you're able to do so? If yes try the same steps in jenkins windows batch command. If no then you're doing something wrong with the command.

What do you mean by "it does not show at all that npm run build has bee executed." Do you find the build folder if yes then it's working file. Did you check jenkins build job console? if not pls check out the logs.

1
votes

I figured it out. The problem was with package.json file. I delete it, deleted the node_modules folder and then I ran:

 - npm install
 - npm run build

then everything went smooth. What exactly was wrong with package.json am not sure as it look OK to me.