microsoft / DurableFunctionsMonitor

A monitoring/debugging UI tool for Azure Durable Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[VsCode] Connecting to a task hub results in error like 'npm list -g --depth=0 npm ERR! ...'

scale-tone opened this issue · comments

Starting from v5.2 DfMon's VsCode extension resolves the full true path to func.exe by executing npm list -g --depth=0 (to get the location of npm's global packages) and then looking for azure-functions-core-tools package in that folder.

It appears, that npm list -g --depth=0 might fail, if there's any corruption/incompatibility in those global packages.

If you're getting an error related to this, then the quick solution is to explicitly specify full path to func.exe (or just func on some platforms) via this setting:

image

On Windows that path typically looks like C:\Users\username\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\func.exe. On other platforms it will be different, but similarly related to npm's global folder.

Also getting this error
image

@mikeleuer , do you have azure-functions-core-tools globally installed (since it is a requirement for VsCode ext to work) ?

@scale-tone This extension was working fine until today. I do not use azure-functions-core-tools because I do not use node. (I did not know it was a requirement)

@mikeleuer , in that case the solution for you should be the same - just specify the full path to func.exe (wherever it is on your system) via Custom Path to Azure Functions Host setting.

@scale-tone That worked thank you. "C:\Program Files\Microsoft\Azure Functions Core Tools\func.exe" was the location of the file. Hopefully the extension will auto detect the location with updates.

Would you consider to fall back to system path "func"? I use yarn as my package manager.

@junalmeida , sure, the fix is on its way. Expect a newer version in the next few days.
And I will consider checking yarn global package folder as well.

@junalmeida , but can you please elaborate on what exactly happens in your case?
Does npm list -g throw or does it just return nothing?

It fails with the following message:

Command failed: npm list -g --depth=0 npm ERR! peer dep missing: typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev, required by tslint@5.20.1 npm ERR! missing: loose-envify@^1.1.0, required by react@17.0.2 npm ERR! missing: object-assign@^4.1.1, required by react@17.0.2 npm ERR! missing: loose-envify@^1.1.0, required by react-dom@17.0.2 npm ERR! missing: object-assign@^4.1.1, required by react-dom@17.0.2 npm ERR! missing: scheduler@^0.20.2, required by react-dom@17.0.2 npm ERR! peer dep missing: typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev, required by tsutils@2.29.0

fixed in v5.3

It is not working for me, this is the output I get when it tries to start the backend:

npm list -g failed. Command failed: npm list -g --depth=0
npm ERR! peer dep missing: typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev, required by tslint@5.20.1
npm ERR! missing: loose-envify@^1.1.0, required by react@17.0.2
npm ERR! missing: object-assign@^4.1.1, required by react@17.0.2
npm ERR! missing: loose-envify@^1.1.0, required by react-dom@17.0.2
npm ERR! missing: object-assign@^4.1.1, required by react-dom@17.0.2
npm ERR! missing: scheduler@^0.20.2, required by react-dom@17.0.2
npm ERR! peer dep missing: typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev, required by tsutils@2.29.0
Using Functions host: C:\Users\junior\AppData\Local\Yarn\bin\func
Attempting to start the backend from c:\Users\junior\.vscode\extensions\durablefunctionsmonitor.durablefunctionsmonitor-5.3.0\backend on http://localhost:37072/a/p/i...

No response within 60 seconds. Ensure you have the latest Azure Functions Core Tools installed globally.

It seems the file it is trying to start is not correct, as bin\func is for bash on *nix. On windows it should be either bin\func.cmd or C:\Users\junior\AppData\Local\Yarn\Data\global\node_modules\azure-functions-core-tools\bin\func.exe.

Apologize, I should have tested this with yarn on Windows (I only tested on Linux).

Please, specify the explicit path to func.exe as a workaround.

No need to apologize, this happens. And yes I can confirm it works if I set func.exe explicit.

Re-fixed in v5.4. Please, validate