I try to run the function emulator on my mac but get the following error on start.
Any ideas ?
$ func host start
......
info: Worker.Node.3dce2ab7-8ac1-43e8-97f0-88c8b2a8554d[0]
Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/Users/myUsername/.azurefunctions/bin/workers/node/grpc/src/node/extension_binary/node-v59-darwin-x64/grpc_node.node'
info: Worker.Node.3dce2ab7-8ac1-43e8-97f0-88c8b2a8554d[0]
module.js:544
info: Worker.Node.3dce2ab7-8ac1-43e8-97f0-88c8b2a8554d[0]
throw err;
info: Worker.Node.3dce2ab7-8ac1-43e8-97f0-88c8b2a8554d[0]
^
info: Worker.Node.3dce2ab7-8ac1-43e8-97f0-88c8b2a8554d[0]
Error: Cannot find module './Worker.js'
Try installing with this: npm i -g azure-functions-core-tools@core --unsafe-perm
I did that already and did it again. I have to use sudo though.
Sadly, this changes nothing.
Found the problem. I had node version 9.2 installed. After downgrading to 8.9 its working now.
The tool looks pretty broken now. @ahmelsayed are you looking at this?
It looks like newer versions of node need a newer grpc extension, that's why going back to v8.9.0 is working. Node v9.2.0 would require node-v59-darwin-x64/grpc_node.node to work.
The Azure functions cli install only provides support for these extensions:
node-v57-darwin-ia32
node-v57-darwin-x64
node-v57-linux-ia32
node-v57-linux-x64
node-v57-win32-ia32
node-v57-win32-x64
Thank you @Knaackee and @nelak for find the root cause of the issue. I'll update package.json to set 8.x as the upper bound of node, though for actual support of node 9.x the issue should go on the runtime repo here https://github.com/Azure/azure-webjobs-sdk-script/issues
Just saving a few minutes for folks with Macs - to revert to Node 8.x:
% brew link node@8 --force ~
Linking /usr/local/Cellar/node@8/8.9.4... 7 symlinks created
% node -v ~
v8.9.4
Any timeline for when this will work with node 9.x?
You can also fall back to the non-core version of cli by using the non-core version of node.
Install via "npm i -g azure-functions-core-tools" instead of "npm i -g azure-functions-core-tools@core".
Any update on this? Huge hassle for Macs.
@ntomsic For linux as well
And now we are at Node 10 for LTS.
This issue was moved to Azure/azure-functions-host#2758
Most helpful comment
Found the problem. I had node version 9.2 installed. After downgrading to 8.9 its working now.