【发布时间】:2021-10-13 18:17:47
【问题描述】:
每次我通过 VSCode 部署我的 Azure Function 应用程序时,@azure/functions 节点模块都会不断被删除,并且 import 语句会显示找不到该模块的错误。我知道 Azure 中不需要这个包,但是如何配置我的 launch.json 以在部署完成后自动重新安装它?现在我必须手动运行 npm install @azure/functions --force 并重新启动 VSCode 才能再次识别导入。
这是我的 package.json 依赖部分:
"dependencies": {
"@azure/service-bus": "^7.3.0",
"@azure/storage-blob": "^12.8.0"
},
"devDependencies": {
"@azure/functions": "^1.2.3",
"@types/jest": "^27.0.2",
"jest": "^27.2.4",
"karma-jasmine": "^4.0.1",
"ts-jest": "^27.0.5",
"typescript": "^4.0.0"
}
这是我的 launch.json:
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start"
}
【问题讨论】:
标签: node.js typescript visual-studio-code azure-functions