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");
http.createServer(function (req, res) {
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hai! welcome to node.js...!\n");
}).listen(3030, "localhost");
console.log("Server running at http://127.0.0.1:3030/");/*
While running the above program.Im getting following error.
module.js:340
throw err;
^
Error: Cannot find module 'C:\Program Files\NetBeans 7.0.1\hello.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:903:3
But the above program works from the terminal.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With