Where I am currently:
I have began working on a NodeJS native extension I intend to work with Electron, but from previous works I have noted that the build steps for building for just NodeJS are as expected, include the libraries as per instruction and change to output a .dll file with a .node extension.
The problem I am facing:
When compiling my extension, which tried and tested within NodeJS, does not work within an Electron contained instance of NodeJS - from searching around I understand this to be a problem with the header files which I am compiling against etc. The documentation for building with visual studio (not Visual Studio Code) is very sparse and everywhere generally points to using node-gyp - which is something I'm attempting to avoid and build using purely Visual Studio 2015.
For reference, when running the working (in NodeJS) NativeExtension I get the following error (which googling brought me to the conclusion I am compiling against the wrong thing):
ELECTRON_ASAR.js:167 Uncaught Error: Module did not self-register.
Could someone please shed some light on where I may be going wrong? I am a novice when it comes to C++ program structure and compiling methodologies.
The documentation for building with visual studio (not Visual Studio Code) is very sparse and everywhere generally points to using node-gyp - which is something I'm attempting to avoid and build using purely Visual Studio 2015.
There is a standard way of compiling native Node modules, and as a self admitted novice it would be unwise to deviate from it. I suggest you read through the Microsoft NodeJS guidelines and get your development environment properly configured to build via node-gyp, once that's working you can start figuring out how to rebuild native Node modules for Electron.
Related
I am currently experiencing a strange issue with Node.js within Visual Studio.
I'm currently working on multiple projects (containing many typescript files - i've read elsewhere this could possibly have something to do with my problem) in Visual Studio 2015 (Version 4.7.02053). I have node.js (v 6.10.0) installed on my dev machine also. Currently we are using the built in TypeScript compiler within visual studio (previously using grunt for ts compilation, now just for sass).
I've also configured visual studio to use the current version of node I have installed (please see screenshot below):
Custom Path to node.js installation
My issue is this, whenever I open one of my projects, multiple, I mean a lot, I mean like between 50-100 node.exe processes spin up, please see the image below!
Lot's of node processes, seems to be update-notifier\check.js???
This is eating away at my CPU and rendering my machine barely usable, especially when i have three or four separate projects open at the same time.
I've attempted to google a fix for this but haven't come up with anything that has worked thus far, so, any help you could possibly give me is greatly appreciated.
Thanks in advance,
Paul
This seems to have to do with the update-notifier package.
I am trying to update from VS2013->VS2015, and to do that I need to rebuild my boost library files using VS2015. I grabbed the latest boost (1.58). By default boost is trying to build with VS2013. I tried to invoke bjam with toolset=msvc-14.0 but this did not work, as it keeps saying:
'cl' is not a recognized as an internal or external command
I guess it doesn't know where VS2015 is located? Does anyone know what I need to change to get boost to build with VS2015?
BlueGo is a tool which builds Boost using Visual Studio 2010/12/13/15. You just have to start the application, select your configuration and hit the Build button- everything else works automatically. The application downloads the library, extracts it and builds it. Can be downloaded from here.
Screenshot of BlueGo:
You also need to install Common Tools for Visual C++ 2015 as described here.
Prebuild boost libraries for VS2015 can be found here. Those seem to be very carefully maintained.
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
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.
I have had quite the experience trying to compile wxWidgets on Windows for x64. After a nightmare setting up Visual C++ 2008 express to compile x64 apps, I opened the wx.sln file. (I'm using wxWidgets 2.9.0, by the way.) I picked the Release configuration and set x64 as the platform. When I hit build, I get a slew of errors saying that wx/setup.h is missing. It would seem like the file is not being created. The real mystery is that the above steps work perfectly for wxWidgets 2.8.10. Any idea why this does not work?
Ensure that you have the file include/wx/msw/setup.h (in particular, it wouldn't be there if you checked sources out of svn). Other than that also check that you use vc9 versions of the project files just to be sure that you don't run into some import problems. With these projects all the necessary setup.h under lib/vc_lib (or vc_dll) directory should be created automatically by custom build steps in the projects.