How to run the node.js file in net beans?

前端 未结 7 1459
再見小時候
再見小時候 2021-01-02 11:19

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         


        
7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-02 11:58

    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.

提交回复
热议问题