

In your case, you called res.redirect(), which caused the response to become Finished. For example, look for callbacks that are accidentally called twice, or any error that happens after the body is sent. When you see this error, try to look for anything that tries to send a header after some of the body has already been written. The error "Error: Can't set headers after they are sent." means that you're already in the Body or Finished state, but some function tried to set a header or statusCode. After writeHead, the headers are baked in and you can only call res.write(data), and finally res.end(data). You are allowed to call res.setHeader(name, value) as often as you want until you call res.writeHead(statusCode). The res object in Express is a subclass of Node.js's http.ServerResponse ( read the http.js source). However, our Jenkins server is behind a corporate inner firewall and needs the proxy setup. Fortunately, the proxy isn't needed for the developers' machines. This way, a new developer can get this project to build with just running mvn package much like they do with all of our other projects.


We want the Eirslett Maven Frontend Plugin to install NodeJS if it's not already installed. However, the Eirslett Maven Frontend Plugin can also install NodeJS too and Artifactory can't be set as the HOME of NodeJS. We have configured NPM to use our Artifactory server for downloading. We use Artifactory which has its own proxy settings. I created $HOME/.m2/ and then called Maven via mvn -s $HOME/.m2/. I created a special version of my settings.xml file with the added proxy settings (just to make sure that nothing is going to affect other projects). Instead, I had to put the proxy setting inside my $HOME/.m2/settings.xml file. The Eirslett Maven Frontend Plugin does not use $http_proxy or the proxy settings in the $HOME/.npmrc file. I think the error may be the proxy, but I could be wrong. (install node and npm) on project ihcm-config-tool: Could not \Ĭonnect to :80 [/104.20.23.46, \ Ĭom.github.eirslett:frontend-maven-plugin:0.0.24:install-node-and-npm \ No proxy was configured, downloading directly To /opt/tomcat/jenkins_home/jobs/ihcm-config-tool-trunk/workspace/node_tmp/ Creating temporary directory /opt/tomcat/jenkins_home/jobs/ihcm-config-tool-trunk/workspace/node_tmp frontend-maven-plugin:0.0.24:install-node-and-npm (install node and npm) ihcm-config-tool. Yet, I still get a no proxy is set error. I have $HOME/.npmrc configured and both http_proxy and https_proxy environment variables set.

This builds on my local machine with a proxy warning, but it won't build on our Jenkins server. Plus, it allows our developers to build via mvn package just like they do with with our other Java/Maven projects. This frontend takes care of installation and other issues for us. We are using the Eirslett Maven Frontend Plugin to help build our NPM projects in a standard way.
