I've installed nodejs on windows and tried adding the canvas module using the following command...
npm install canvas
I get the following error message...
'node-waf' is not regonized as an internal or external command, operable program or batch file.
Is there a way to install node-waf on windows or an alternative way to install modules?
I have read that you should try to use Gyp instead of node-waf. It's apparently better cross platform as well.
Up to version 0.4 the node.js team offered node-waf (a waf 1.5.3 wrapper script) to configure and build modules for node.js. This was fine since in windows there was no native support and you had to use Cygwin to make your builds. From version 0.5 and on, there node supports native windows builds which brings visual studio in to play. The problem is that waf started supporting visual studio’s msbuild from version 1.6 and on and this was a major setback. In the meanwhile the node.js team decided to move on to gyp and abandoned the node-waf script. If you are tempted to create a node-waf wrapping waf 1.6, try to resist. A lot of things have changed in waf 1.6 and when I finished modifying the script, I still couldn’t generate proper windows builds (I would have to hardwire the linking arguments in order to link the object to node.lib just for windows). On the other hand, gyp supports custom arguments depending on the building platform which makes the gyp files easier to maintain.
http://botsikas.blogspot.com/2011/12/nodejs-modules-cross-platform.html
You can also use canvas implementation based on GDI+ https://bitbucket.org/pastorgluk/node-canvas-win
Related
I'm trying to install Yesod through cabal on my HP computer, but the building process fails when shakespeare library gets the turn. MSYS2+MinGW in the path, the rest actually works. What could be the issue? I have my suspicions that it might be due to the x64 processor I have, but not sure.
Tried installing globally with runhaskell, but same story.
C:\Users\Ivan Kretov>cabal install shakespeare
Warning: The install command is a part of the legacy v1 style of cabal
usage.
Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become
the default in the next version of cabal-install. Please file a bug if
you cannot replicate a working v1- use case with the new-style commands.
For more information, see: https://wiki.haskell.org/Cabal/NewBuild
Resolving dependencies...
Starting shakespeare-2.0.20
Building shakespeare-2.0.20
I'm developing an application that I plan to distribute using node-webkit, which only has 32-bit binaries on Windows. My OS is Windows 7 Ultimate 64-bit, so npm is building 64-bit binaries of protobuf for node, which is a prerequisite of one of the modules I am using.
I have tried:
npm install protobuf --arch=ia32
npm install protobuf --target_arch=ia32
npm set npm_config_arch ia32
Installing the 32-bit version of node and npm and using it to install protobuf
And a few other things that I can't remember at the moment.
How can I get npm to build 32-bit binaries? Would I have to build it on a 32-bit machine?
You should be able to clone the repo into node_modules yourself and compile it manually using
node-gyp clean configure build --verbose --arch=ia32
inside the directory where you cloned the repo.
Add a file in your project root called .npmrc
Windows explorer doesn't allow creation of a file name starting with a dot, but this can be done on windows command line like this:
type NUL > .npmrc
Then add the following line to the file:
npm_config_arch=ia32
You may also want to put this line in there to force VS build version, since some packages want to use non-installed versions. Replace 2013 with your version of Visual Studio if different (2012, etc):
msvs_version=2013
Tried the suggestion offered by asherkin and Derrick and suggest the below
npm set npm_config_arch ia32
npm clean-install --arch=ia32
The first command is to set the node environment of the project/folder to 32bit.
The second command is to reinstall all packages in 32bit.
I am trying to use stackage on windows. I cloned the git repo, ran cabal install --only-dependencies, cabal configure, cabal build. Everything works
then dist\build\Stackage\stackage.exe select
Loading Haskell Platform
Loading package database
Narrowing package database
Printing build plan to build-plan.log
Checking for bad versions
authenticate-oauth-1.4.0.8 (FP Complete <michael#fpcomplete.com> #yesodweb) cannot use:
- RSA-2.0 -- ==1.2.*
threepenny-gui-0.4.1.0 (FP Complete <michael#fpcomplete.com>) cannot use:
- aeson-0.7.0.2 -- ==0.6.*
stackage.exe: Conflicting build plan, exiting
the readme mention *.sh scripts like ./patching/scripts/create-tarballs.sh. I tried but failed to run them with cygwin. Are they important?
How can I use stackage on windows?
edit I was able to run the ./patching/scripts/create-tarballs.sh script using msys. But now the error message is:
Loading Haskell Platform
Loading package database
stackage.exe: Missing cabal file "MFlow-0.3.3/MFlow.cabal" in tarball: "patching/tarballs\\MFlow-0.3.3.tar.gz"
I checked the archive: the cabal file is inside.
Windows users are not recommended to install stackage by Haskell Platform installer due to some limitation:
On Windows, it does not provide a complete environment (missing MSYS).
By placing a large number of packages in the global package database, Haskell Platform installations are more easily corrupted.
The choice of package versions conflicts with the needs of many commonly used packages.
Some of the package versions included with the platform have known and severe bugs, and cannot be reliably upgraded.
As for solution to overcome, uninstall the Haskell platform first, then install minghc for windows by the following link: https://github.com/fpco/minghc#readme
Open command prompt run cabal update and cabal install alex happy.
Finally, install stackage.
Update 2015
A new tool has been developed by Commercial Haskell group for project development -- Stack, it can be install along with the latest Haskell Platform (7.10.2).
Features include:
Installing GHC automatically, in an isolated location.
Installing packages needed for your project.
Building your project.
Testing your project.
Benchmarking your project.
I have tried it for haskell web project, it works smoothly.
All,
Likely a noob question, but being brand new to node.js I'm stuck and going in circles so looking for a little prodding in the right direction (my skills are .NET and browser JS).
My first node.js application will read the Windows serial port, so I want to use the voodootikigod / node-serialport module that seems to be the best one to use with node.js on Windows. I have followed the instructions to build it on windows by cloning the github source locally and use node-gyp to configure and build and that works successfully with no errors.
However, I need to install this into a local npm repository so I can 'require' it in my application. I'm using the new Visual Studio Node.js tools for VS (which are an excellent way for a .net developer to get started with node.js) however the included npm package manager can't install from a local folder.
So not knowing much about NPM I am assuming to install this into the local NPM repository with the following command line "npm install" from the local github folder, and it goes pulling all the dependencies but there is an embedded script that runs the following command "node-gyp rebuild" and it is here it falls over with the error: MSB4036 the "VCBuild" task is not found.
I'm using VS 2013 pro, and I thought VCbuild was replaced by MSbuild a while back. So it looks like I have to edit the script that node-gyp rebuild tries to run but I don't know enough about npm and node-gyp to sort this out.
It's likely a dumb newbie problem - can someone point me in the right direction? Thanks.
Do you have all the requirements in place for node-gyp on Windows (see the readme)? Windows 7 requires Python 2.7 and VS 2010 and Windows 8 requires VS 2012 C++.
I know this may be a stupid question to ask but I want to be sure about using node.js on windows. Can I use node.js on windows with any way ?
Thanks
There's Windows binaries for Node itself, but it's crippled without the package manager npm.
Update: As of December 2011 there's a Node installer for Windows that bundles the package manager npm. How this rocks! http://nodejs.org/
Yes, there is currently official unstable version of node.js for windows. Check out Windows executable in download section.
The 0.5.x (unstable) branch comes with a pre-compiled node.exe. Odd branches are for development though, so it would be good enough for hacking around with (has some feature gaps), but you'll need to wait until 0.6.x for a stable "off-the-shelf" solution in windows.
Yes you can.
Download the node.js binaries from http://node-js.prcn.co.cc/
Unzip it to any location, you need 7zip to unzip it.
Then put the node.js bin directory into path.
Use terminal to run node
With 0.4.x and earlier versions it is better to use pre-compiled binaries from http://node-js.prcn.co.cc/ . To extract, you can use WinRar in addition to 7zip.
The 0.5.x branch barely works in Cygwin, and official support for Cygwin was dropped, so you will have to use the precompiled the native windows exe http://nodejs.org provides. NPM doesn't work with 0.5.x prior to 0.5.8, but for 0.5.8 and later there is an instruction how to get NPM running:
http://npmjs.org/doc/README.html#Installing-on-Windows-Experimental
I installed the Node.js Azure SDK from http://go.microsoft.com/fwlink/?LinkId=254279&clcid=0x409 . Open up a command prompt and type 'node' - you're good to go.
I have set this report on my experience setting a portable node.js ambient on Windows.
In order to leverage it you must be a full newbie.
It is not installed the Windows way, but instead it's made of expanded archives.
After doing the steps you end up with a command-line invironment capable of running node.js together with a few more tools usually found in UNIX-like environments.
It's here: http://bit.ly/YbGYVg