Azure-functions-core-tools: Cannot install on Mac

Created on 26 Sep 2017  路  6Comments  路  Source: Azure/azure-functions-core-tools

I am trying to install the cli on my mac using the following:

npm i -g azure-functions-core-tools@core

It is failing with the following message:

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm ERR! notsup Valid OS:    win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   darwin
npm ERR! notsup Actual Arch: x64

Most helpful comment

can you try

rm -rf /usr/local/lib/node_modules/azure-functions-core-tools # or where ever your global npm packages go

# then
sudo npm i -g azure-functions-core-tools@core --unsafe-perm

_--unsafe-perm docs_

All 6 comments

/cc @mamaso

can you make sure your node version >= 8.4.0? It looks like our package has that dependency now and it's messing with npm version resolution for some reason. I think it's trying to give you the latest that supports your node engine version or something, but it's falling back to a pretty old version.

We will remove that restriction from the package

and the version you want is 2.0.1-beta.17, not 1.0.0-beta.100 which is very old

@ahmelsayed I am running node v8.4.0.

One thing I noticed is that if I install locally (without the -g flag) it resolves to the correct version 2.0.1-beta.17 but when -g flag is used, it falls back to v1.0.0-beta.100

I tried uninstalling this version from global packages with npm uninstall -g azure-functions-core-tools however, I get the same error described above. So it looks like I cannot uninstall or upgrade this package globally at the moment.

can you try

rm -rf /usr/local/lib/node_modules/azure-functions-core-tools # or where ever your global npm packages go

# then
sudo npm i -g azure-functions-core-tools@core --unsafe-perm

_--unsafe-perm docs_

an alternative to --unsafe-perm (if you don't want to run install script as root) is to do

npm config --global set user $(whoami | id -u)

that should tell npm to run the install scripts as your UID instead of nobody, though this will affect any package you install with sudo.

Just to close the loop. The only thing that worked was the

rm -rf /usr/local/lib/node_modules/azure-functions-core-tools # or where ever your global npm packages go

# then
sudo npm i -g azure-functions-core-tools@core --unsafe-perm

I was able to install with this.

Was this page helpful?
0 / 5 - 0 ratings