# Problem when trying to run node-red from sources

**URL:** <https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286>\
**Category:** General\
**Created:** [18 December 2019 03:16 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286 "2019-12-18T03:16:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsl400](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dsl400/32/11876_2.png) [@dsl400](https://discourse.nodered.org/u/dsl400)\
**Post date:** [18 December 2019 03:16 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/1 "2019-12-18T03:16:19Z")

</div>

I ran into a bit of an issue while trying to run node-red from sources.  
Any help will be highly appreciated 🙂

`fs-ext\fs-ext.cc(195,31): error C3861: 'fcntl': identifier not found`

```auto
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\dsl400\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\dsl400\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\dsl400\AppData\Roaming\npm\node_modules\node-red\node_modules\fs-ext
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

```

`\node_modules\nan\nan_maybe_43_inl.h(88,23): error C2039: 'ForceSet': is not a member of 'v8::Object' (compiling source file ..\src\binding.cc)`

```auto
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\dsl400\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\dsl400\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\dsl400\AppData\Roaming\npm\node_modules\node-red\node_modules\zmq
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

```

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 December 2019 08:08 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/2 "2019-12-18T08:08:48Z")

</div>

Is this on Windows (10)?

---

<div class="post-metadata">

**Author:** ![dsl400](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dsl400/32/11876_2.png) [@dsl400](https://discourse.nodered.org/u/dsl400)\
**Post date:** [18 December 2019 08:28 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/3 "2019-12-18T08:28:59Z")

</div>

yes, w10 x64

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 December 2019 09:45 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/4 "2019-12-18T09:45:50Z")

</div>

Just tried it out and it doesn't work on my Win10 either ☹

It worked fine when I did it on a Pi a little while ago

Going to try using admin cmd window and see if any different

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 December 2019 10:39 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/5 "2019-12-18T10:39:10Z")

</div>

Actually - I've realised I am getting a different issue - mine seems to be picking up settings from my normal install ☹

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/79b723d983e326c307448c22be92de7a6df22ebd.png)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 December 2019 11:19 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/6 "2019-12-18T11:19:29Z")

</div>

Got it working

Didn't realise/forgotton/not in instructions that I needed to have a settings.js file in my folder (otherwise it defaults to using my normal c:\users\simon.node-red one

So I copied it across - changed port number to 1881 and also told it to use my c:\nrsource\node-red folder as the user folder and it works

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b174ea0a4a88509e048f3a18a2975fde72627876.png)

maybe try that on yours and see what happens?  
[edit]  
`npm start -- -s settings.js -u .`

works as well to save having to name the folder

@knolleary @dceejay Could we have a settings.js file automatically be installed in the folder? And could  
`npm start`  
be amended to  
`npm start -- -s settings.js -u .`  
in the docs?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 December 2019 11:30 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/7 "2019-12-18T11:30:03Z")

</div>

When you install Node-RED, we don't know where you want the user directory to be, so we cannot create it and populate it with anything until you run for the first time.

> [@cymplecy](#):
>
> could  
> `npm start`  
> be amended to  
> `npm start -- -s settings.js -u .`  
> in the docs?

For what reason? Why make it look more complicated to run than it really is? We do document the command-line options that can be used.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 December 2019 11:34 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/8 "2019-12-18T11:34:57Z")

</div>

> [@knolleary](#):
>
> When you install Node-RED, we don't know where you want the user directory to be, so we cannot create it and populate it with anything until you run for the first time.

In my (simple) mind - the node-red folder is created when you do the git clone - so if a settings.js file was in  
`github.com/node-red/node-red`

then it would be in the right place for when the npm start is run

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 December 2019 11:38 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/9 "2019-12-18T11:38:24Z")

</div>

Oh sorry, I missed this was related to a git clone rather than an npm install.

If you are running in the root of the source tree, you really don't want that to also be used as your userDir as you then pollute the src tree with all your user data.

So which bit of the docs are you proposing that change in? We could add a comment to the effect of how to run with a custom user dir if you are already at the point of running from src rather than the recommended install from npm.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 December 2019 11:49 UTC](https://discourse.nodered.org/t/problem-when-trying-to-run-node-red-from-sources/19286/10 "2019-12-18T11:49:11Z")

</div>

Well its this page I'm working from as far as documentation is concerned  
[https://nodered.org/docs/getting-started/development](https://nodered.org/docs/getting-started/development)

> [@knolleary](#):
>
> If you are running in the root of the source tree, you really don't want that to also be used as your userDir as you then pollute the src tree with all your user data.

That doesn't sound good !

Could the user create a folder user and then use that

`npm start -- -s settings.js -u user`

would that avoid pollution
