In net beans i have installed node.js pulgin.But my sample node program is not working.Im getting error. This is my sample code
var http = require(\"http
Your Node code looks fine. Have you really created the hello.js file in the NetBeans folder as it looks like Node cannot find the file in this folder?
If you go to the node options in NetBeans, you need to make sure you are changing directory to the folder that contains your application source. This is done in NetBeans by setting the "Default Run Command" to be something like:
cd ${workingdir};
/usr/local/bin/node ${selectedfile};
Where you need to set the path to node as appropriate.
From my knowledge, currently there are 2 netbeans plugins for Node.js
The one you're using http://plugins.netbeans.org/plugin/36653/nodejs
(very simple plugin, it doesn't do much (I used it on an older version of netbeans), and I can't get it to work on netbeans 7.4)
and a second one:
NetBeans NodeJS Plugin https://github.com/timboudreau/nb-nodejs
I want to suggest that you switch to the second one, because:
Netbeans Node support does not appear quite ready for prime time. Problem: the "standard" (danielkec) Node plugin does not know about projects, so you will have to create a bogus (Html5??) project to use it. Problem2: Tim Boudreau's Node plugin does nicely with project creation and code completion but it has zero support for debugging (Tim prefers inserting print statements in the code). So at this point (Netbeans 8), I would not recommend Netbeans for Node.js work.
In NetBeans go to Tools >> Options >> Miscellaneous >> Node.js
and change default command to:
node ${workingdir}\${selectedfile}
You should also add lessc file path to your netbeans. In netbeans go to:
Tools >> Options >> Miscellaneous >> CSS Preprossessors
And add path to your node lessc file path.
It will be located in C:\Users\{your user name}\AppData\Roaming\npm\lessc.cmd
If it is not found then you have to install it by command prompt by following code:
npm install less -g
Netbeans 8.1 now has Node.js debugging support. Simply right click the file and click 'Debug'.
I had the same problem, not a lot of resources available!! finally found one which solved.
https://www.youtube.com/watch?v=b3giUSvRjPc https://joanpaon.wordpress.com/2015/08/13/how-to-setup-nodejs-with-netbeans-8-1beta/
and install nodejs from nodejs.org in the windown cmd run the command c:>npm install express-generator -g
fortunately, netbeans has the search option to find the necessary resources for node js.