node.js - Azure Functions 本地 HTTP 触发器问题及解决方案
问题描述
只是想发布我在尝试在 VS Code 中本地运行 Azure 函数 HTTP 触发器时遇到以下错误后采取的步骤:
"[error] Incompatible Node.js version. The version you are using is v13.1.0,
but the runtime requires an LTS-covered major version. LTS-covered versions
have an even major version number (8.x, 10.x, etc.) as per
https://github.com/nodejs/Release#release-plan. For deployed code, change
WEBSITENODEDEFAULT_VERSION to '~10' in App Settings. Locally, install or
switch to a supported node version (make sure to quit and restart your code
editor to pick up the changes)."
解决方案
(1.) 安装 NVM。此处的说明:https ://github.com/nvm-sh/nvm#installing-and-updating
(2.) 安装 NVS。这里的说明:https ://github.com/jasongin/nvs
(3.) 在您的 VS 代码终端中,运行:
nvs add 12.16.1
nvs use node/12.16.1/x64
(4.) 将您的 launch.json 编辑为以下内容:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 5555,
"preLaunchTask": "func: host start"
}
],
"node": {
"runtimeVersion": "12.16.1"
}
}
(5.) 在您的 VS 代码终端中,运行:
func start
推荐阅读
- node.js - Webpack 4 ts-loader 和 less-loader 在某些 pc 上不起作用
- php - 检查两次之间的时间(用户输入)(在一个 foreach 之外)
- php - 隐藏的输入得到错误的 ID
- c# - 在c#中将dd/mm/yyyy字符串转换为yyyy-dd-mm DateTime
- php - 当提交 NULL 值时,laravel 雄辩的查询没有给出正确的结果
- zapier - “得到一个缺少“id”属性的结果” - Zapier
- .htaccess - .htaccess 在 url 中隐藏子目录
- python - Pandas/Numpy 根据存在将行移入列
- python - 我如何订阅消费者并通知他 Django 频道的任何变化
- c# - 从选定的列表 ID 显示视图中的类