Unable to find node.exe and main.js file to start appium hence unable to start appium programatically

I am trying to start appium programatically I installed appium through npm using the below command
npm install -g appium
before this I installed nodejs too. Previously when I used to install appium it gets installed in C drive of my machine but now surprisingly it’s taking C:/User/UserName/AppData/Roaming/npm/appium… where I am not able to find node.exe as it used to come within the Appium folder only but unable to find it. I wrote a Java program to start appium programatically as below:-

return service = AppiumDriverLocalService.buildService ( new AppiumServiceBuilder ( )
.usingDriverExecutable ( new File (
“C:\Program Files\nodejs\node.exe” ) )
.withAppiumJS ( new File (
“C:\Users\UserName\AppData\Roaming\npm\node_modules\appium\build\lib\main.js”) )
.usingPort ( port )
.withArgument ( GeneralServerFlag.LOG_LEVEL ,
“debug” ) ) ;

surprisingly the appium is not starting and not even a single error shown to identify the exact issue (which is really breaking my head). I tried to start manually with the same path for node and appium which I provided above which got started successfully but not happening when trying programatically. I can proceed by starting it manually but not interested to do so hence thought of doing it programatically which I am unable achieve hence please provide some solution as I am really panic to solve this since 1 week

Appium 1.6.5
Node v6.10.3
Java (JRE) 1.8.0_131
OS : Windows 10

Strange thing is appium itself not happening hence request for a help. This worked well in previous versions of Java but in latest version getting failed

please help
unable to find node.exe file while installing appium through node