# Projects not finding Git

**URL:** https://discourse.nodered.org/t/projects-not-finding-git/6333
**Category:** General
**Created:** [3 January 2019 01:00 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333 "2019-01-03T01:00:38Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![beneuto](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@beneuto](https://discourse.nodered.org/u/beneuto)
#### Post date: [3 January 2019 01:00 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/1 "2019-01-03T01:00:38Z")

</div>

Anyone had success using Projects in node-red run on Azure App Service? I'm getting the error below despite being able to run both "git" and "ssh-keygen" from the command line.

"Projects disabled : git command not found"

Node-red v0.19.5  
Node.js v8.11.1

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [3 January 2019 14:01 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/2 "2019-01-03T14:01:28Z")

</div>

Is git available in the Azure App Service?

---

<div class="post-metadata">

### Author: ![beneuto](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@beneuto](https://discourse.nodered.org/u/beneuto)
#### Post date: [3 January 2019 23:00 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/3 "2019-01-03T23:00:07Z")

</div>

Yep. It's mainly used for managing application code but uses a standard git command line tool.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [3 January 2019 23:08 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/4 "2019-01-03T23:08:53Z")

</div>

Maybe it isn't on the path when you have started Node-RED? How are you starting it?

---

<div class="post-metadata">

### Author: ![beneuto](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@beneuto](https://discourse.nodered.org/u/beneuto)
#### Post date: [4 January 2019 01:36 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/5 "2019-01-04T01:36:27Z")

</div>

It runs on Express so maybe that is the problem.

server.js:

```
var express = require("express");
var RED = require('node-red');
var app = express();
var http = require('http');

var PORT=process.env.PORT;

var server=http.createServer(app);
var settings=require("./settings.js");

RED.init(server,settings);

app.use(settings.httpAdminRoot,RED.httpAdmin);
app.use(settings.httpNodeRoot,RED.httpNode);
 
server.listen(settings.uiPort);
console.log(`listening port:${settings.uiPort}`);
RED.start();
```

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [4 January 2019 22:44 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/6 "2019-01-04T22:44:43Z")

</div>

> [@beneuto](#):
>
> It runs on Express so maybe that is the problem.

I don't believe so. That is just running Node-RED in embedded mode. I believe it will be how the app is started. It will have been started without a PATH and therefore inside the context of Node.JS, ExpressJS and Node-RED, git cannot be found.

---

<div class="post-metadata">

### Author: ![beneuto](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@beneuto](https://discourse.nodered.org/u/beneuto)
#### Post date: [7 January 2019 01:09 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/7 "2019-01-07T01:09:11Z")

</div>

Thanks for the pointer Julian. Turns out that there appears to be a bug in Azure in that the PATH variable used by the IIS Application Pool is pointing to a 32 bit directory for Git when in fact the 64 bit version is installed.

I have worked around this by manually adding the required directory to the path in the server.js file:

```
var express = require('express'),
    RED = require('node-red'),
    http = require('http'),
    settings = require('./settings.js');

var app = express(),
    server = http.createServer(app);

process.env.Path = 'D:\\Program Files\\Git\\cmd;D:\\Program Files\\Git\\usr\\bin;' + process.env.Path;

RED.init(server,settings);

app.use(settings.httpAdminRoot,RED.httpAdmin);
app.use(settings.httpNodeRoot,RED.httpNode);
 
server.listen(settings.uiPort);
console.log(`listening port:${settings.uiPort}`);
RED.start();
```

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [7 January 2019 17:49 UTC](https://discourse.nodered.org/t/projects-not-finding-git/6333/8 "2019-01-07T17:49:17Z")

</div>

Great, glad that got sorted.

By the way, you can avoid all those backslashes and errors by using `path.join` which always gives valid paths for the target OS. It tends to be a lot safer than using manual path strings.
