Tag: netbeans

如何在net beans中运行node.js文件?

在净豆我已经安装node.js pulgin.But我的示例节点程序不工作。我得到错误。 这是我的示例代码 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/");/* 当运行上面的程序。我得到以下错误。 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 但是上面的程序是从terminal上运行的。