Problem when trying to run node-red from sources

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

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

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)

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

Is this on Windows (10)?

yes, w10 x64

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

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

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

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

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?

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.

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.

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

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.

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

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