NodeJS - plugin detailNode.js support in Netbeans IDE. Node.js installation is required, you can edit execution command in options/miscellaneous/Node.js. On windows you will see a bubble notification in the right left corner which says plugin reconfigured cmd in options for running node on win. Then you can run again with expected results.
[ You have to be logged in to be able to comment. ] User CommentsChanging the colors
On the screen picture of the plugin above there is some TypeError of red color and some blue links below. How can I change its colors? I changed the background for dark-grey and this dark-blue is barely visible. I tried to change the colors in settings (error color; link color) but with no result. It's still red/blue. Thanks in advance.
Posted by devrafalko on Sep 08, 2017
How to run App with NodeJS on Windows
1) NetBeans > Tools > Options > Miscellaneous > Node.js > Default run command: node D:\WorkSpace\UI\app.js
2) NetBeans > Tools >Options > General > Web Browser > Chrome > Edit > Arguments: http://localhost:8702/#/orders 3) Right-click app.js and "Run with Node.js". This should start your node. 4) Then just simply "Run Project" to access UI locally on Chrome via NetBeans
Posted by Sumeet on Oct 06, 2015
better config on Mac/linux @ netbeans(menu) - Preferences - Miscellaneous - node.js:
#default run command:
cd ${workingdir}; echo 'run node project @' && pwd; /usr/local/bin/node ${selectedfile}; ################# #default kill command: echo 'killing node'; pkill node; ################# you can kill all node instances before starting new instance to be sure that only one process is running ..that means every new run will explicitly kill previous node run if exists.. for that purpose use this config for default run command: #default run command: echo 'killing running node if exists'; pkill node; cd ${workingdir}; echo 'run node project @' && pwd; /usr/local/bin/node ${selectedfile}; ################# Here please, to note that I have node installed to be run @ /usr/local/bin/node .. it may differ from your node path. so change it if its necessary.
Posted by alefon on Feb 22, 2015
RE:RE:How to stop the server
Hello spayc,
you can customize killall cmd in Options>Miscellaneous>Node.js Did you tried that? Can you run killall node in cmd under same user as NB jvm runs on?
Posted by danielkec on Nov 20, 2014
RE: How to stop the server
Ver 2.2 is not stopping the node instances. In fact it is creating more node processes.
ps aux is showing: S 21:02 0:00 /bin/sh -c cd ${workingdir};?node ${selectedfile}; Sl 21:02 0:00 node for each time I clicked stop all running instances (I'm impatient, there were several). For those wondering S = interruptible sleep (waiting for an event to complete) and l = is multi-threaded. Ubuntu 12.04, Netbeans 8.0
Posted by spayc on Jun 06, 2014
How to stop the server
New version 2.2 for NetBeans 8 has action to stop all running instances of nodejs.
Enjoy, Daniel
Posted by danielkec on Mar 24, 2014
Changing directory in Windows
I was getting the same error which @mrosefelt has mentioned.
I used the below command which solved the issue (Change the directory immediately using /D option). cd /D ${workingdir} && node ${selectedfile} Hope this helps. Also we can set this string as default for 'Reset for Windows' option.
Posted by vivasaayi on Mar 24, 2014
Cannot Stop the server
I can't seem to figure out how to stop the server. I can run with node.js fine but if I want to make a change I assume I have to stop the server save changes and run again and I can't find an option to stop the server.
This is probably obvious but, I can't seem to find it so any help would be appreciated. (Similar question was asked before but there was no reply from NETBEANS COMMUNITY)
Posted by anujspoddar on Mar 15, 2014
Run with cscript.exe?
good job! impressive.
would you please give me your source code? Can you create another plugin? Run with cscript.exe Run with wscript.exe (on windows platform) And Run with Mozilla Rhino: {path_to_jre}java.exe -jar {path_to_rhino_jar}js.jar xxx.js (unix & win) https://developer.mozilla.org/en/docs/Rhino Thank you canegor@rambler.ru
Posted by Canegor on Feb 22, 2014
RE: mrosefelt
Could you please just click the button "Reset for windows" on the plugin options? If you have correctly installed node.js there is no need to configure anything. Alias for node is "node", change dir is just setting current dir to look for ${selectedfile}, when you click on the "Reset for windows" it will cd to the ${workingdir}. Like this: "cd ${workingdir} && node ${selectedfile}"
Posted by danielkec on Dec 02, 2013
Re: How to change exec dir
Thanks Daniel.
Still not quite there: cd "C:\Program Files\nodejs" && node ${selectedfile} Error: Cannot find module 'C:\Program Files\nodejs\jsTester01.js' cd "C:\Program Files\nodejs\" && node ${selectedfile} Error: Cannot find module 'C:\Program Files\nodejs\jsTester01.js'
Posted by mrosefelt on Nov 26, 2013
RE: mrosefelt
Hi,
The path in the options have to be set to the directory with node binary (node.exe on windows). Your tested file will be located when you click run node.js in netbeans. Daniel
Posted by danielkec on Nov 23, 2013
How to change the execution dir?
I'm not able to get this plugin to change to the correct directory to execute my script.
I have node.js and your plugin installed. I've set the Tools/Options/Miscellaneous/NodeJS path to the directory which contains the file that I am testing, but that directory is not being used, so executing file "jsTester01.js" produces this error: module.js:340 throw err; ^ Error: Cannot find module 'C:\Program Files\NetBeans 7.3.1\jsTester01.js' NB 7.3.1 on Win7 x64 I did restart NB after setting the option to: cd "D:\Artstuff\MiscWebStuff\html samples" && node ${selectedfile} Thanks.
Posted by mrosefelt on Nov 22, 2013
RE: danielkec
I've already read that post. But it dosen't describe how to set up everything in NetBeans.
Posted by VisionarY on Nov 19, 2013
RE: VisionarY
Please ask google next time, this is not right place to ask such question.
First result on goole: http://stackoverflow.com/questions/5818312/mysql-with-node-js
Posted by danielkec on Nov 19, 2013
RE: jhsachs
This plugin doesn't add project type nor file type, it never did,it is just adding "Run with Node.js" action to the context menu of js file.
If you look at screenshot, it's shown right there.
Posted by danielkec on Nov 19, 2013
Nodejs with MySQL in NetBeans?
Can anyone please describe how I can use Nodejs with MySQL within the NetBeans IDE?
Have look around without finding any guides, so any answers are much appreciated :-)
Posted by VisionarY on Nov 19, 2013
RE: Support for NetBeans 7.3?
Thank you, Daniel. I tried installing the 7.2 version. The installation appears to have been successful, but either I don't understand how to use the plugin or it isn't working.
I tried to create a Node.js project, but the New > Project menu didn't have a Node.js option, so I created an HTML/JavaScript project. I added a Hello World program in a file named index.js. The context menu for adding a file from the Project pane did not have a Node.js option either, although it had two options named JavaScript, which might have been due to an unsuccessful attempt to add a Node.js file type. With index.js open and selected, I executed the Run > Run command. It opened a dialog that said I have to install a Chrome extension, which makes me believe that it was trying to run the file as a JavaScript file rather than a Node.js file.
Posted by jhsachs on Nov 05, 2013
RE: Support for NetBeans 7.3?
Just download 7.2 version I'm pretty sure it will work on 7.3
Posted by danielkec on Nov 04, 2013
Support for NetBeans 7.3?
I'm running NetBeans 7.3.1 under Windows 7. The plugin manager doesn't list your product, and the tabs on the manual download page only go up to 7.2. Do you have plans to support 7.3.x in the near future?
Posted by jhsachs on Nov 01, 2013
Stop node server
I can't seem to figure out how to stop the server. I can run with node.js fine but if I want to make a change I assume I have to stop the server save changes and run again and I can't find an option to stop the server.
This is probably obvious but, I can't seem to find it so any help would be appreciated.
Posted by ryanzor on Aug 08, 2013
RE: Not work in windows 7
It would be nice to post that error .. so I could help you. It's been tested on Win7 and it's working properly. Have you checked the default command?
Posted by danielkec on Apr 23, 2013
Not work in windows 7
Hi. I download the plugin and install it in netbeans. but whan i try to run a JS file using node.js , it throws error.. i don't wats happening. BUT IT WORKS PROPERLY FROM TERMINAL
Posted by aarthi on Mar 13, 2013
RE: systemovich
Untrusted is the certificate of our company probably because it has expired long ago, that's all. You can check if the company is real here:
https://or.justice.cz/ias/ui/vypis-vypis?subjektId=isor%3a100009408&typ=full&klic=1bvl6y And that is actually what those certificates are for. Daniel
Posted by danielkec on Feb 06, 2013
Untrusted
When I try to install this plugin, Netbeans says it is untrusted.
Why is that?
Posted by systemovich on Feb 06, 2013
RE: fra.casula
This plugin doesn't add support for the project type, so there is no reason to say "it soesnt work". If you read description above it says clearly :
"In NetBeans IDE execute selected javascript file with editable command. Default command is node /blah/blah/some.js."
Posted by danielkec on Oct 03, 2012
doesn't work with netbeans 7.2
I've downloaded netbeans 7.2 full version linux x64...
I've found this plugin in Tools => Plugins => Available Plugins but after installation there is no Node.js support and no project type for node.js
Posted by fra.casula on Oct 03, 2012
Thanks
Thanks Daniel, that works perfectly.
And thanks for explaining why it happened. John
Posted by jhermsen on Sep 14, 2012
RE: jhermsen
Well you are using undocumented part of the Grunt API,
if you read comment in the source code: "This is only executed when run via command line.", you probably should look for the methods wich are specifically calling tasks. Cli function takes as the second argument async function which is executed when build is done instead of "process.exit(0);". On Linux it doesn't matter but on win is causing that process invoked externally doesnt flush output in time. So on windows calling method cli should look like this: "grunt.cli({},function(){});" Then even the JVM can catch your output, because process.exit is not called. To fix your code call grunt like this: "require('grunt').cli({},function(){});" Good luck, Daniel
Posted by danielkec on Sep 13, 2012
RE: jhermsen
I know what binary is but that is what netbeans tells me.
If I run a basic nodejs file with only console.log command and redirect to file there is no message opening the file. If I use grunt like I showed below which does work actions are performed so node grunt.js command works, but the output is not shown in the output window. If I then redirect the output to file and open it in netbeans I get the message: This file appears to contain binary data. Are you sure you want to open it in the text editor? And the file contains all data, so why doesn't it visible in the output window if I run it without redirect? Becuase I call the grunt module cli it works with "node grunt.js" also from commandline showing me the output as expected. Just not in your plugin. Hope you can help on this, because I'd like to call it from netbeans and see results there. Thanks, John
Posted by jhermsen on Sep 13, 2012
RE:jhermsen
I am convinced that you do not know what the word "binary" means.
Anyway I have a limited awareness of grunt but I do not think that you use it properly. File grunt.js of Grunt build tool is equivalent to build.xml file of the Ant. If you want to build your project, you have to run grunt command from the command line in the folder where the file grunt.js is present. So running "node grunt.js" is useless, instead run just "grunt". I wish you good luck with grunt Daniel
Posted by danielkec on Sep 12, 2012
Binary output?
Nodejs working, but for some reason the grunt module doesn't return the output to the output window.
At least on Windows. To reproduce: Test script: console.info("Node start" ); module.exports = function( grunt ) { grunt.registerTask('foo', function(arg1, arg2) { console.info("testNode" ); grunt.log.error('Error'); }); grunt.registerTask( "default", "foo" ); } grunt = require('grunt'); grunt.cli(); if I run standard this is the window output: cd "C:\Scripts" && node grunt.js Node start if I run adding output redirection 1> log.txt to the command. This is the window output: cd "C:\Scripts" && node grunt.js 1> log.txt And the output to the log.txt (binary format according netbeans maybe that's the issue): Node start [4mRunning "foo" task[24m testNode [31m>> [39mError [32mDone, without errors.[39m Can the binary format be the issue with capturing in the plugin? Grunt format's the output with color codes and things like that.
Posted by jhermsen on Sep 12, 2012
Button to stop and relauch most recent app
Is there a way to add a button or shortcut to
stop and relauch the most recent app which was started by using the context menu ? Tghis would save us using boring context menus
Posted by daslicht on Sep 03, 2012
It works perfectly on Windows
Just change the command from cd ${workingdir} && node ${selectedfile} to node ${workingdir}\${selectedfile}, of course node should be on the path, remember Windows path variable and dir commands. I'm using Windows 7 Enterprise and netBeans 7.1.2 but I think it doesn't matter.
Posted by esc123 on Jul 07, 2012
Hi !!!!
You have clearly mistaken my plugin with module Tim Boudreau made: http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js
So thanks for reporting me a bug which is not mine, of a feature which my plugin doesn't support.
Posted by danielkec on Jul 04, 2012
Cannot run program "npm"Hi! When i try "Add Library" result ide: java.io.IOException: Cannot run program "npm": error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at org.netbeans.modules.nodejs.libraries.LibrariesPanel.run(LibrariesPanel.java:240) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1452) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2032) java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(UNIXProcess.java:0) at java.lang.UNIXProcess.(UNIXProcess.java:53) at java.lang.ProcessImpl.start(ProcessImpl.java:91) at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) at org.netbeans.modules.nodejs.libraries.LibrariesPanel.run(LibrariesPanel.java:240) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1452) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2032) help please. but the npm is installed on local macchine!! tnx http://statistics.netbeans.org/analytics/exception.do?id=596513
Posted by marcoberri on Jun 29, 2012
Runs on Windows too
Hey guys I have made some modifications, nice thing is the feature Andrew Skiba suggested:
http://andskiba.blogspot.com/2011/09/nodejs-plugin-for-netbeans-and-daemons.html It is already incorporated in new version, thank you Andrew
Posted by danielkec on May 24, 2012
RE: Crashes on Windows
There is a big sign above which says
"Works only under Unix like systems for now!" NodeJS works under win not the plugin itself ... yet. I will upload multiOS version shortly
Posted by danielkec on May 23, 2012
Crashes on Windows
IDE 7.1.2 on Windows (Zip package, OS-independent)
Crashes when trying to run Node. Bug report submitted. http://statistics.netbeans.org/analytics/detail.do?id=177717 Node.js configured properly in Node.js tab. Removed ';' on Windows but it makes no difference.
Posted by mistery1 on May 22, 2012
What about daemons?
The way this plugin waits for process.waitFor in cz.kec.nb.nodejs.RunNode.performAction makes impossible to use the plugin with long processes, like HTTP server. So I hacked the sources given by Danielkec, and now it prints the output of the node in a separate thread: http://andskiba.blogspot.com/2011/09/nodejs-plugin-for-netbeans-and-daemons.html
Posted by skibaa on Sep 18, 2011
Why not on windows?
Well my plugin itself is working on win just fine but "this" won't work there because node.js is not yet ported for windows.
So it's not my personal vendeta against windows :] But there is a hope for win loving self tormentors: http://zd.net/mNci67
Posted by danielkec on Jun 27, 2011
Why not on windows?
Could you perhaps give a short explanation, why this doesn't work on windows?
Posted by TheDet on Jun 27, 2011
Source is available
Just mention Syntea software group in the description of the plugin if you use them please. If you can use some help with your plugin contact me on daniel[at]kecovi.cz i will be pleased to join you.
srcs: http://www.syntea.cz/netbeans-modules/nbjs/NodeJS.tar.7z
Posted by danielkec on May 30, 2011
Source available?
I have a NetBeans node.js plugin I've been working on, which adds a project type (npm integration & code completion hopefully soon). Is the source for this available?
Posted by tboudreau on May 25, 2011
|