Syntax Errors in Netbeans while using promises and node.js - node.js

I have a working node.js project with 4.5+ node.js and Q Promise. I am using netbeans to edit the project. However i am getting syntax error all over the project. How can i and from where can i add dependency/plugin in netbeans to avoid these syntax issues.
Here is a sample

Download the just released NetBeans 8.2, it has support for ES6
https://netbeans.org/downloads/

Related

Google Cloud Speech Recognition grpc version incompatible with VSCode Electron Version

My goal is to develop a VS Code extension with speech recognition, ideally via google's API.
When attempting to import and use #google-cloud/speech, the following error is thrown at runtime:
Error: #grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0
VS Code (as of 6/20/2019) is running electron 3.18 and node.js 10.2.0. Does this mean there is no way to work around this issue?
I'm following this tutorial: https://cloud.google.com/speech-to-text/docs/streaming-recognize
Sounds like it should work starting with the next release then. From the preliminary 1.36 release notes:
The Electron version that VS Code runs on has been updated and brings with it an update to Node.js from 10.2.0 to 10.11.0. All extensions will now run on this newer version of Node.js.
To make sure, you can try an Insider's build.
Generally speaking though, there's no way to control what Node version VSCode extension run on (see here), so I guess you got lucky here. :)

Can I use ES6 modules in a Node.js application and debug it in Visual Studio?

I've tried building a basic node.js ES6 module test project in Visual Studio 2015. But I get build errors and cannot run or debug the application in VS.
Have I just came to the party too early?
If it's worth anything I have tried opening and building the project in both VS2013 (Update 3) and VS2015 RC.
I have installed:
Node.js 0.12.2
Node.js Tools 1.0 for VS2013
Node.js Tools 1.1 Beta for VS2015
Additionally, I have added Robert Penners () node.d.ts gist to get over the import syntax errors.
See: https://gist.github.com/robertpenner/7d48f184df1236c4fdca
I have uploaded the project for others to try: https://dl.dropboxusercontent.com/u/10159140/es6-modules-ts.zip
Node Tools dev here. Thanks for reporting this. Indeed, we support the ES6 typescript target type.
That said, I'm running into issues running your app in the command line altogether with the latest versions of both node and io.js, so this may be a level of ES6 support mismatch between all the components at play here... Have you managed to successfully run your app in the command line (without the debugger)? Otherwise it may be related to this discussion:
https://github.com/nodejs/io.js/issues/1000
Once you figure that out, be sure to set up your project with the right node.exe arguments (harmony flag and whatnot) in project properties, so Visual Studio knows how to run it too.
Hope that helps!
P.S. just an fyi - we've moved to GitHub now, so please post issues there (rather than on CodePlex) for the quickest responses.
https://github.com/Microsoft/nodejstools

How to debug node.js app typescript file in Visual Studio 2013

I have an Node.js app written by typescript. I have VisualStudio 2013 and Node.js tools for Visual Studio, so I can debug compiled .js files in node.js runtime.
I can debug typescript files for browser html application.
How can I debug typescript files for node.js environment?
It is trivial to debug nodejs javascript applications using webstorm : http://www.youtube.com/watch?v=6bKsDoFj83o I would suggest doing the same in typescript case i.e. debug your js.
I tried to do this a while ago and found it quite frustrating, I don't think it's possible to use the Visual Studio debugger for TypeScript with Node applications at the moment. You're also limited to using Internet Explorer for debugging and most developers seem to use Chrome these days.
That said Node and TypeScript debugging is possible, there's a link here. The process is a little funky but basarat is on the right track - WebStorm is probably a superior development environment for JavaScript applications and it has good support for the compile to languages (TypeScript, CoffeeScript, Dart). I haven't tried debugging TypeScript with Node apps using WebStorm but according to this thread it is possible.
UPDATE:
I've just had a quick look at the NTVS site (see here) and there are workarounds but they're not easy and this remains a work in progress
With the 1.0 beta release of NTVS it is now very simple to debug node.js applications in visual studio (version 2013), as this release contains the typescript compile templates which previous versions did not contain. The new functionality lets you debug directly in your typescript code.
If you are using previous versions you can get around the missing templates by having two projects in your solution, one for a web application (this does the typescript build) and one for the nodejs tools to debug the js code.

TypeScript - not updating javascript after 0.9 install

First I did not have intellisense when using typescript.
So I installed typescript 0.9 for vs2012.
Now I have intellisense but the javascript files no longer updates.
I have checked the typescript options "compile typescript on save".
Still, nothing compiles.
Ideas?
My guess is that you updated your Web Esentials plugin to newest version.
Web Essentials no longer supports TypeScript compilation.
You have two options to fix your problem:
Revert back to earlier version of web essentials (2.7 or 2.6)
Update your project file to handle TypeScript compile
see: https://typescript.codeplex.com/wikipage?title=Compile-on-Save
and http://vswebessentials.com/changelog
This may also be helpful: https://typescript.codeplex.com/discussions/454045

Is there a NodeJS plugin for Aptana Studio?

Is there a NodeJS plugin for Aptana Studio?
At least for NodeJS code-assist
And perhaps a way to create NodeJS project
And local NodeJS debugging
We have no NodeJS support currently. If this is something the community is interested in, it'd be helpful to file a feature request and vote it up: http://jira.appcelerator.org/secure/CreateIssue!default.jspa
Since we are built on eclipse, you should be able to try out the instructions for NodeJS debugging on Eclipse, found here: https://github.com/joyent/node/wiki/Using-Eclipse-as-Node-Applications-Debugger
As for special NodeJs projects, there's no notion of that. You would likely just create a normal Web project. We do have the concept of libraries that you can add to a project, wherein you could point to js files/libs for NodeJS. We also has special syntax files for describing JS libraries/APIs so it can be integrated into our content assist. A good example might be the ruble we have for jQuery which contains that file for two versions of the jQuery API. Here's the 1.6.2 version: https://github.com/aptana/javascript-jquery.ruble/blob/master/support/jquery.1.6.2.sdocml The bundle.rb up in the parent directory hooks up the file in the ruble/bundle.
My guess is that creating an analogous NodeJS ruble and building up an sdocml (xml) file that described the API would be the easiest way to get started. Sharing that on github and sending it to us would allow for others to contribute as well. There are docs for creating rubles here: http://wiki.appcelerator.org/display/tis/Creating+a+new+Ruble
UPDATE: Project URL is http://nodeclipse.github.io/
There is Nodeclipse.org effort. Current version is 0.11 see http://www.nodeclipse.org/history .
Recommended installation for Aptana users through Enide - Eclipse Node.js IDE
Features
Creating default structure for New Node Project and New Node Source File
JavaScript Syntax highlighting
Content Assistant
NPM support
Debugging - Breakpoint, Trace, etc... via modified Eclipse debugger plugin for V8
CoffeeScript support
Installing
Update Site : http://www.nodeclipse.org/updates/
Read also Hints (section Aptana Studio)
(source: nodeclipse.org)
Read http://www.nodeclipse.org/ for more & latest information.
I highly recommend using Sublime Text 2.
There are a few nodejs plugins as well as v8 javascript [Sublime v8] and standard ECMA-262.
This is not a direct answer to your question, but if you're looking for a good IDE for node.js, you should definitely try Microsoft WebMatrix 2. It basically does what you requested to do.
I was fed up of fighting with Aptana Studio and plugins and all this stuff... until I found out Sublime Text. Simple and wonderful.

Resources