Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Windows (64 bit) #619

Closed
relu-xz opened this issue Aug 30, 2015 · 13 comments
Closed

Installation Windows (64 bit) #619

relu-xz opened this issue Aug 30, 2015 · 13 comments

Comments

@relu-xz
Copy link

relu-xz commented Aug 30, 2015

I was trying to install node-canvas but without success.

@relu-xz
Copy link
Author

relu-xz commented Aug 30, 2015

After a few hours of research, this is my two cents:


All installed dependencies are 64 bit.

Environment

Steps

  1. Follow the guide "Installation Windows" until step #3.
  2. Open a terminal and execute the following commands:

npm config set msvs_version 2015 --global

npm install canvas

Congratulations! You've successfully installed node-canvas.

Note: Please, it's IMPORTANT to follow the guidelines exactly as you see.

Troubleshooting

I had some problems installing another modules. For example, node-gyp is another problematic module when you want to install it on Windows (check this) but this guide is excellent to getting things installed:

Building using Node-GYP with Visual Studio Express 2015 on Windows 10 Pro x64

The guide works fine for Windows 8.1, because Windows 10 is Windows 8.1 with plastic surgery =D. In my case I just had to set the environment variable (GYP_MSVS_VERSION=2015). By the way, if you want to a painless environment variables management, you can use Rapid Environment Editor.

Testing

To test if everything is ok, I've used Trianglify:

npm install trianglify
cd node_modules/trianglify/examples
node save-as-png.js random.png

If you can see random.png inside of examples/, you can breathe =)

Final words

HTH!

@klentgary
Copy link

Hello sir, I got an error when Im trying to install the canvas. please help me,

this is the error I've got.

C:\Users\admin>npm -g install
npm ERR! addLocal Could not install C:\Users\admin
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files (x86)\\Mobile App\\node.exe" "C:\\Program Files (x86)\\Mobile App\\node_modules\\npm\\bin\\npm-cli.js" "-g" "install"
npm ERR! node v4.1.0
npm ERR! npm  v2.14.3
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall read

npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\admin\npm-debug.log

@LinusU
Copy link
Collaborator

LinusU commented Oct 15, 2015

@klentgary Did you follow the instructions posted? It seems like you only ran npm -g install, that wouldn't install canvas at all.

What you want to do is either npm install canvas or follow the instructions posted above.

@relu-xz
Copy link
Author

relu-xz commented Oct 15, 2015

@klentgary, as @LinusU says, did you follow all instructions? did you install all the dependencies?

I've updated the step 4.

@relu-xz
Copy link
Author

relu-xz commented Nov 22, 2015

Instructions updated

@LinusU
Copy link
Collaborator

LinusU commented Feb 15, 2016

@zorobabel Thanks a ton for the instructions, and for linking the bugs! I've gone thru and closed them 👍

@relu-xz
Copy link
Author

relu-xz commented Feb 15, 2016

@LinusU You're welcome, thanks to you, too!

@joxford-soltech
Copy link

joxford-soltech commented Jun 30, 2016

If anyone is still seeing errors related to a win_delay_load_hook.c file, take a look at this issue.

Basically you need to node-gyp global path, it should be something like

C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src

and open the win_delay_load_hook.c file with a text editor in Administrator Mode. Add

#ifndef DELAYIMP_INSECURE_WRITABLE_HOOKS
#define DELAYIMP_INSECURE_WRITABLE_HOOKS
#endif

before the first #include

@imyevolove
Copy link

ohh god. THANK YOU SO MUCH!!!! I LOVE YOU!!

@ghost
Copy link

ghost commented Oct 27, 2017

Is this going to be merged? Into code? In to instructions?

@ghost ghost mentioned this issue Oct 27, 2017
Closed
@zbjornson
Copy link
Collaborator

joxford-soltech's comment was fixed in node-gyp, it's not a canvas issue.

@ghost
Copy link

ghost commented Oct 27, 2017 via email

@ghost
Copy link

ghost commented Oct 27, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants