azure-functions-core-tools: Can't update core tools

Hi,

i can’t update the core tools because the module ‘unzipper’ is not found. Got the error when using the VSCode Command or running it in the terminal.

image

npm i -g azure-functions-core-tools@3 --unsafe-perm true
npm ERR! code 1
npm ERR! path C:\Users\mje\AppData\Roaming\npm\node_modules\azure-functions-core-tools
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node lib/install.js
npm ERR! node:internal/modules/cjs/loader:927
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module 'unzipper'
npm ERR! Require stack:
npm ERR! - C:\Users\mje\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\install.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:769:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:996:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:92:18)
npm ERR!     at Object.<anonymous> (C:\Users\mje\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\install.js:3:18)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1092:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:972:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:813:14)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     'C:\\Users\\mje\\AppData\\Roaming\\npm\\node_modules\\azure-functions-core-tools\\lib\\install.js'
npm ERR!   ]
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mje\AppData\Local\npm-cache\_logs\2021-03-29T07_41_54_784Z-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 19 (2 by maintainers)

Most upvoted comments

Thanks @FabioFerrua

@CarsonPLS i agree. I think it doesn’t solve the real problem. When installing the core tools you shouldnt manually install all dependencies globally.

The frustrating part is that this has been ongoing with little response for weeks.

Yet VS Code reminds me of this issue about 4 times a day… (each time I open a new window)

MS, please just keep us posted… is it us being dumb, or is this something you have identified that you need to fix?

The workaround that has worked most if not all is to run

npm uninstall -g azure-functions-core-tools then npm i -g azure-functions-core-tools@3

Not ideal but did resolve the issue for me twice (across 2 updates of the library)

Ok, thanks. But this should be put into the update script.

The workaround that has worked for most, if not all, is to run

npm uninstall -g azure-functions-core-tools

then

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

Not ideal but did resolve the issue for me twice (across 2 updates of the library)

Hi @MJECloud and others, we have assigned this to be better investigated so we can better understand the problem. Thank you for your updates!

@stemixreal thanks for the update!

I’ve uninstalled and reinstalled the core tools via vscode and now it works! image The first version is before the reinstallation, the second after.

@CarsonPLS @FabioFerrua maybe it works for you too!

The fix for me is in my reply to #2544. Perhaps it will help. I was getting the same errors as detailed in the OP when the required modules do exist in the correct location.