我想用(https://docs.microsoft.com/zh-cn/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=python)创建一个聊天机器人
本教程要求我使用npm安装botdispatch。因此,我在cloud cli中使用了“ npm i -g npm”,但是由于权限被拒绝,所以无法执行此操作。
有什么办法可以在Cloud CLI中解决此问题?还是我需要在本地安装cli?cloud cli和local cli之间有什么区别吗?
Azure Cloud CLI是沙盒环境。您在此环境中没有管理员权限。
但是,npm i -g
将尝试为全局安装模块,这需要管理员权限。因此,cmd将失败。
因此,您可以只删除-g
cmd。然后指定js模块的整个路径。例如:
npm i botdispatch
./node_modules/botdispatch/bin/dispatch.js init -n <filename-to-create> --luisAuthoringKey "<your-luis-authoring-key>" --luisAuthoringRegion <your-region>
或者,您可以在本地使用CLI和NPM,如果您是管理员用户,则一定可以使用。