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

Add node-v48-win32-ia32? #27

Open
DonKarlssonSan opened this issue Nov 29, 2017 · 5 comments
Open

Add node-v48-win32-ia32? #27

DonKarlssonSan opened this issue Nov 29, 2017 · 5 comments

Comments

@DonKarlssonSan
Copy link

Hi,

I'm trying to use canvas-prebuilt on Azure Functions but there is an error during installation:

node-pre-gyp ERR! install error 
404 status code downloading tarball https://github.com/chearon/node-canvas-prebuilt/releases/download/v1.6.5-prerelease.1/canvas-prebuilt-v1.6.5-prerelease.1-node-v48-win32-ia32.tar.gz
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/chearon/node-canvas-prebuilt/releases/download/v1.6.5-prerelease.1/canvas-prebuilt-v1.6.5-prerelease.1-node-v48-win32-ia32.tar.gz
node-pre-gyp ERR! stack     at Request.<anonymous> (D:\home\site\wwwroot\flowfieldimagetweetbot\node_modules\node-pre-gyp\lib\install.js:118:27)
node-pre-gyp ERR! stack     at emitOne (events.js:101:20)
node-pre-gyp ERR! stack     at Request.emit (events.js:188:7)
node-pre-gyp ERR! stack     at Request.onRequestResponse (D:\home\site\wwwroot\flowfieldimagetweetbot\node_modules\request\request.js:1074:10)
node-pre-gyp ERR! stack     at emitOne (events.js:96:13)
node-pre-gyp ERR! stack     at ClientRequest.emit (events.js:188:7)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:472:21)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:105:23)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:361:20)
node-pre-gyp ERR! stack     at emitOne (events.js:96:13)
node-pre-gyp ERR! System Windows_NT 6.2.9200
node-pre-gyp ERR! command "D:\\Program Files (x86)\\nodejs\\6.5.0\\node.exe" "D:\\home\\site\\wwwroot\\flowfieldimagetweetbot\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install"
node-pre-gyp ERR! cwd D:\home\site\wwwroot\flowfieldimagetweetbot\node_modules\canvas-prebuilt
node-pre-gyp ERR! node -v v6.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 

It's looking for canvas-prebuilt-v1.6.5-prerelease.1-node-v48-win32-ia32.tar.gz but that does not exist so it fails. I saw this comment in the readme:

I have some ideas on how to get these working with cross-compilation if people request it. I plan to add Linux/ARM

So I'm wondering if it is possible to add Windows x86/ia32 builds as well? (node-v48-win32-ia32)

The node version in Azure Functions is currently locked at 6.5.0.

I've tried switching my Azure Function to 64 bit but that made no difference. Somehow the npm scripts detects the platform arch as 32.
image

@zbjornson
Copy link
Member

(Sorta off-topic: Is it easy for you to see the output of process.arch and require("os").arch() with a 64-bit function? Curious if that's a bug in Azure's deployment or in node-pre-gyp's detection.)

@DonKarlssonSan
Copy link
Author

Aha! Conflicting info. Azure Functions seems to be the one to blame for reporting x86 to node-pre-gyp

D:\home>node test.js
ia32 ia32

D:\home>node --version
v6.5.0

D:\home>cat test.js
console.log(process.arch, require("os").arch());

System info

System up time: 1.21:10:02
OS version: Microsoft Windows NT 6.2.9200.0
64 bit system: True
64 bit process: True

Environment variables

REMOTEDEBUGGINGBITVERSION = vx64
REMOTEDEBUGGINGPORT =
REMOTEDEBUGGINGVERSION = 11.0.611103.400
SCM_SKIP_SSL_VALIDATION = 0
SCM_USE_FUNCPACK = 0
ScmType = GitHub
SITE_BITNESS = AMD64

@chearon
Copy link
Member

chearon commented Nov 30, 2017

If it's an option for you, you can pass --target_arch=x64 to npm install and that should override node-pre-gyp's choice. I probably won't get around to adding 32 bit support seeing as I still haven't done ARM and that has been a popular request 😕

@DonKarlssonSan
Copy link
Author

Thanks! I will try that.

@rand0me
Copy link

rand0me commented Aug 6, 2018

  1. Switching Azure Function to x64 can't help because:
$ node -p "process.arch"
> ia32
  1. --target_arch=x64 can't help too, because Node.js process arch is ia32 (i.e. they install x32 Node.js version on a x64 machine)
  2. Some people says, that we can try Azure Functions on Linux to achieve this, but in my case it didn't help, because it has Node.js 6.11 😁

So, as for now, no way to install and use node-canvas on Azure Function App

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

No branches or pull requests

5 participants
@chearon @zbjornson @DonKarlssonSan @rand0me and others