如何在 azure cli 中使用 npm?
how to use npm in azure cli?
制作一个聊天机器人
教程要求我使用 npm 安装 botdispatch。所以我在 cloud cli 中使用 "npm i -g npm",但由于权限被拒绝,我不能这样做。
有什么方法可以在云客户端中解决这个问题吗?或者我需要在本地安装cli?云cli和本地cli有区别吗?
Azure Cloud CLI 是一个沙盒环境。您在此环境中没有管理员权限。
但是,npm i -g
将尝试安装全局模块,这需要管理员权限。所以 cmd 将失败。
因此,您可以在 cmd 中删除 -g
。然后指定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,如果您是管理员用户,这当然可以。
教程要求我使用 npm 安装 botdispatch。所以我在 cloud cli 中使用 "npm i -g npm",但由于权限被拒绝,我不能这样做。
有什么方法可以在云客户端中解决这个问题吗?或者我需要在本地安装cli?云cli和本地cli有区别吗?
Azure Cloud CLI 是一个沙盒环境。您在此环境中没有管理员权限。
但是,npm i -g
将尝试安装全局模块,这需要管理员权限。所以 cmd 将失败。
因此,您可以在 cmd 中删除 -g
。然后指定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,如果您是管理员用户,这当然可以。