我想在VSCode上运行func
命令,但是错误在下面。
<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
文件中设置。)npm list -g
上我尝试删除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
我在VSCode的settings.json
中设置了波纹管。
{
"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
我在npm config set proxy http://<CompanyProxyHost>:<PortNumber>/
中运行了npm config set strict-ssl false
和~/.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” 。