This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Please add feature to run a js file with run file in a HTML5 project without node support. | ||
---|---|---|---|
Product: | javascript | Reporter: | Christian Lenz <chrizzly> |
Component: | Node.js | Assignee: | Tomas Mysik <tmysik> |
Status: | NEW --- | ||
Severity: | normal | CC: | tmysik |
Priority: | P3 | ||
Version: | 8.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | Gulp test with testScript |
Description
Christian Lenz
2016-04-14 12:12:17 UTC
Could you please attach a sample project? BTW I would guess that your JS file was run using JDK (see Tools > Options > Java > Nashorn). Thanks. Created attachment 159268 [details]
Gulp test with testScript
So testScript.js is my little node script what I should run with "Run File", what is not possible, because the gulp-test-nb project is a HTML5 project with disabled node.js support. As you can see in the gulpfile, I wanted to call the test module, doesn't matter what is in. So this is a real world example, where you have helpers (testScripts.js) which you want to call inside gulp for example, but it is a normal HTML5 Client Side Project.
The problem is not, that I don't want to enable node.js, if this is normal behaviour and has no other side effect, the problem is, that when I want to execute the file with ctrl + u, nothing happens or with the context menu, Nashorn, as you said, will execute it. To execute the file correct, I have to enable node.js.
As discussed in issue #268933: Perhaps it would be nice if any JS file _outside_ the Site Root folder could have Run/Debug action which would invoke Node.js (if Node.js is enabled for the given project, of course). This would work for all kind of "helper" scripts (for building, deplyment etc.). Thanks. One more note: the current implementation adds Run/Debug action to JS files that are underneath Source Files folder only. Thx for the comment. Yes this will open the files inside the browser, which doesn't make sense to me. |