Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
I am publishing mobile app on phonegap using nodejs. It's working perfectly fine when I execute the code But when I hit the url, then I got the follwing error:

'node' is not recognized as an internal or external command, operable program or batch file.

Please help me out. DO I need to do some setting in web.config or on the server.

I am using the following code to run node js script

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
startInfo.FileName = "cmd.exe";
startInfo.Verb = "runas";

startInfo.Arguments = "/c node C:/inetpub/vhosts/pigeonsocial.com/pigeonsocial/xyzabc/Node/example/post.apps.js testapp C:/inetpub/vhosts/pigeonsocial.com/pigeonsocial/xyzabc/UserApps/pbpraveen1988@gmail.com/praveen/praveen.zip";

// startInfo.Arguments = "/c node C:\\node-phonegap-build-api-master\\node-phonegap-build-api-master\\example\\post.apps.js -t anaghaappname -t www.zip";
//startInfo.Arguments = "appname";
//startInfo.Arguments = "BasicCalculator.tar.gz";
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
process.StartInfo = startInfo;
process.Start();
string result = process.StandardError.ReadToEnd();
string output = process.StandardOutput.ReadToEnd();


But getting error
Posted
Updated 4-Jan-15 20:41pm
v2
Comments
Richard MacCutchan 2-Jan-15 8:19am    
Somewhere (we have no idea where) you are trying to run the command node in a command shell.
anaghanhale 3-Jan-15 2:13am    
yes but trough c# code
Richard MacCutchan 3-Jan-15 3:52am    
If you want help here then you need to provide some useful information. We cannot guess what you are doing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900