Я хочу выполнить команду func
на VSCode, но ошибка приведена ниже.
<UserName>@W10-1911039 MINGW64 ~
$ func
events.js:200
throw er; // Unhandled 'error' event
^
Error: spawn C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin/func ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn C:\\Users\\<UserName>\\AppData\\Roaming\\npm\\node_modules\\azure-functions-core-tools\\bin/func',
path: 'C:\\Users\\<UserName>\\AppData\\Roaming\\npm\\node_modules\\azure-functions-core-tools\\bin/func',
spawnargs: []
}
Среда
- Она находится под прокси-сервером компании.
(настройки прокси установлены в ~/.bashrc
файле.) - python3 и узел (и npm) установлены и передача завершена.
- azure -functions-core-tools установлен на
npm list -g
Дополнительные шаги 1
Я попытался удалить C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools
и переустановить , но ошибка ниже.
<UserName>@W10-1911039 MINGW64 ~
$ npm list -g | grep azure
<UserName>@W10-1911039 MINGW64 ~
$ npm install -g azure-functions-core-tools
C:\Users\<UserName>\AppData\Roaming\npm\azurefunctions -> C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
C:\Users\<UserName>\AppData\Roaming\npm\func -> C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
C:\Users\<UserName>\AppData\Roaming\npm\azfun -> C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
> azure-functions-core-tools@2.7.2184 postinstall C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools
> node lib/install.js
attempting to GET "https://functionscdn.azureedge.net/public/2.7.2184/Azure.Functions.Cli.win-x64.2.7.2184.zip"
using proxy server "http://<CompanyProxyHost>:<PortNumber>"
Error: self signed certificate in certificate chain
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! azure-functions-core-tools@2.7.2184 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the azure-functions-core-tools@2.7.2184 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<UserName>\AppData\Roaming\npm-cache\_logs\2020-02-13T04_55_46_986Z-debug.log
Дополнительные шаги 2
Я установил ниже settings.json
на VSCode.
{
"http.proxy": "http://<CompanyProxyHost>:<PortNumber>",
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"http.proxyStrictSSL": false
}
И я попытался переустановить azure-functions-core-tools
, но erorr ниже.
<UserName>@W10-1911039 MINGW64 ~
$ npm install -g azure-functions-core-tools
C:\Users\<UserName>\AppData\Roaming\npm\azfun -> C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
C:\Users\<UserName>\AppData\Roaming\npm\azurefunctions -> C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
C:\Users\<UserName>\AppData\Roaming\npm\func -> C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
> azure-functions-core-tools@2.7.2184 postinstall C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools
> node lib/install.js
attempting to GET "https://functionscdn.azureedge.net/public/2.7.2184/Azure.Functions.Cli.win-x64.2.7.2184.zip"
using proxy server "http://<CompanyProxyHost>:<PortNumber>/"
Error: self signed certificate in certificate chain
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! azure-functions-core-tools@2.7.2184 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the azure-functions-core-tools@2.7.2184 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<UserName>\AppData\Roaming\npm-cache\_logs\2020-02-13T09_54_42_193Z-debug.log
Дополнительные шаги 3
Я запускаю npm config set proxy http://<CompanyProxyHost>:<PortNumber>/
и npm config set strict-ssl false
in ~/.npmrc
и попытался переустановить azure-functions-core-tools
, но ошибка ниже.
<UserName>@W10-1911039 MINGW64 ~
$ npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.13.4 node/v12.14.1 win32 x64"
; userconfig C:\Users\<UserName>\.npmrc
proxy = "http://<CompanyProxyHost>:<PortNumber>/"
strict-ssl = false
; builtin config undefined
prefix = "C:\\Users\\<UserName>\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Users\<UserName>
; HOME = C:\Users\<UserName>
; "npm config ls -l" to show all defaults.
<UserName>@W10-1911039 MINGW64 ~
$ npm install -g azure-functions-core-tools
npm ERR! code EEXIST
npm ERR! path C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js
npm ERR! dest C:\Users\<UserName>\AppData\Roaming\npm\azfun
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\<UserName>\AppData\Roaming\npm\node_modules\azure-functions-core-tools\lib\main.js' -> 'C:\Users\<UserName>\AppData\Roaming\npm\azfun'
npm ERR! File exists: C:\Users\<UserName>\AppData\Roaming\npm\azfun
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\<UserName>\AppData\Roaming\npm-cache\_logs\2020-02-14T02_00_32_376Z-debug.log
Поэтому я попытался переустановить azure-functions-core-tools
с параметром --force
, но ошибка вернулась к "Дополнительные шаги 1" .