You must have the Azure Functions core tools installed to debug your local functions.

In this Azure tutorial, we will discuss how to fix the error. You must have the Azure Functions core tools installed. I got this error while running an Azure Function project using Visual Studio Code on my local machine.

You must have the Azure Functions core tools installed to debug your local functions

Recently, while creating one of the Azure Functions Projects, I got the popup below, which showed this warning.

Then I clicked on the Install button to install it.

Azure Function Core Tool Not Installing on VS Code

After I clicked on the Install button, I got the below error

12:01:28 PM: Running command: “npm install -g azure-functions-core-tools@3″…
npm ERR! code EEXIST
npm ERR! path C:\Users\Bijay\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
npm ERR! dest C:\Users\Bijay\AppData\Roaming\npm\func
npm ERR! EEXIST: file already exists, cmd shim ‘C:\Users\Bijay\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js’ -> ‘C:\Users\Bijay\AppData\Roaming\npm\func’

npm ERR! File exists: C:\Users\Bijay\AppData\Roaming\npm\func
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with –force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bijay\AppData\Roaming\npm-cache_logs\2020-08-17T06_31_31_113Z-debug.log

You can see here; it is showing me that some reference files already exist.

azure functions core tools not found
azure-functions-core-tools npm

Solution

To fix this issue, I first opened a new terminal and tried running the command below.

You can also use the Node.js Command Prompt to execute the command below.

npm install -g azure-functions-core-tools@3

But again, I got the same error

you must have the azure functions core tools installed to debug

So now what I did is I ran the below command with — force. You can see that it started installing the Azure Functions Core Tools without any issues.

npm install -g azure-functions-core-tools@3 --force
how to install azure functions core tools in visual studio code

When I tried creating the Azure Functions Project using Visual Studio Code, I got no errors.

To clear this error, install Azure Functions Core Tools with a single method, confirm that func --version works in a fresh terminal, and remove any duplicate installs. Keep one install method across your team, and never commit real secrets in local.settings.json. I hope you found this article helpful.

You may also like the following articles