Building the demo-app using NodeJS/NPM

I’m new to Node.js and NPM. I installed it today on Windows 10/64. I went to GitHub and downloaded the demo-app zip and extracted it in a directory called maidsafe. I also installed NSIS and set it’s path.

I’m able to run npm install, npm start and I even created an installer for the app using npm run packcage. But when I start the demo_app the screens stays empty. I get a lot of errors using npm install. I cd to the dir where the package file is and this is what my console says:

C:\maidsafe\safe_examples-master\demo_app>npm install
npm WARN package.json @ No repository field.
npm WARN package.json @ No license field.
npm WARN optional dep failed, continuing appdmg@0.3.7
\
> nslog@3.0.0 install C:\maidsafe\safe_examples-master\demo_app\node_modules\electron-rebuild\node_modules\nslog
> node-gyp rebuild


    C:\maidsafe\safe_examples-master\demo_app\node_modules\electron-rebuild\node_modules\nslog>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
    gyp ERR! configure error
    gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
    gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:401:14)
    gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
    gyp ERR! System Windows_NT 10.0.10586
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
    gyp ERR! cwd C:\maidsafe\safe_examples-master\demo_app\node_modules\electron-rebuild\node_modules\nslog
    gyp ERR! node -v v4.4.4
    gyp ERR! node-gyp -v v3.3.1
    gyp ERR! not ok
    npm ERR! Windows_NT 10.0.10586
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
    npm ERR! node v4.4.4
    npm ERR! npm  v2.15.1
    npm ERR! code ELIFECYCLE

    npm ERR! nslog@3.0.0 install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the nslog@3.0.0 install script 'node-gyp rebuild'.
    npm ERR! This is most likely a problem with the nslog package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node-gyp rebuild
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs nslog
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!
    npm ERR!     npm owner ls nslog
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\maidsafe\safe_examples-master\demo_app\npm-debug.log

    C:\maidsafe\safe_examples-master\demo_app>

Why is it talking about phyton??

This is what I get when I run npm start:

Anyone an idea what’s going wrong?

1 Like

node-gyp needs python and msvc for building native modules on windows. From the logs, npm install fails when it tries to build the electron-rebuild module. Since we don’t use any native module, I think we can remove the dependency from the package.json

But in case if you wanted to build safe_launcher on windows, python and msvc would definitely be required to rebuild ffi & ref dependencies for electron compatibility.

Please let me know if it helps, I will update the demo_app with a PR to remove the dependency. Also let us know if you face any difficulty in building safe_launcher on Windows.

Thanks @polpolrene

3 Likes

I know nothing whatsoever about this NodeJS/NPM stuff, so let me wade in and offer some help. :smile:

It looks like Python is required as part of your build environment. You can get it from here: Python Releases for Windows | Python.org

Then try again.

EDIT: @Krishna_Kumar beat me to a reply while I was composing this one.

And I dug out my notes about installing MSVC from a few months ago. It is easy for the first-timer to go up a blind-alley or two on this since they have so many packages with confusing names:

  1. Download and install Microsoft Visual C++ Build Tools 2015. This is the standalone/command-line version of the Visual C/C++ compiler; you don’t need to install the full Visual Studio development environment.

  2. Run the download and check the boxes for Windows 8.1 SDK and Windows 10 SDK options.

3 Likes

Did you figure this out @polpolrene I’m trying but am failing. expected because I really don’t know what I’m doing.

I didn’t try is for the last few weeks. I got stuck in errors the last times I’ve tried. But I’m not really a coder either.