javascript - 运行 powershell 命令在电子中不起作用
问题描述
所以我有一个可以运行power shell命令的脚本,主要问题是当我与其他人共享它时它不起作用但是当我在我的电脑上运行它时它确实起作用。
fs.mkdirSync(response.filePaths[0] + "\\Workroom");
fs.writeFileSync(response.filePaths[0] + "\\Workroom\\bot.js", "");
fs.mkdirSync(response.filePaths[0] + "\\Workroom\\node_modules");
require('winax');
var run=new ActiveXObject('WSCRIPT.Shell').Run("npm install --prefix "+response.filePaths[0]+"\\Workroom"+" discord.js", 0);
fs.writeFileSync("./path.txt", response.filePaths[0]);
解决方案
推荐阅读
- python - xlsx 文件中的 datetime.datetime 类型阻止了进程
- database - 根据同一张表中的值获取sql整体
- node.js - 将时间事件与 Node.js 和 Wit.ai 一起用于 Facebook Messenger?
- python - AttributeError:“str”对象没有属性“option_chain”
- java - 如何使用 ISO-8859-6 字符集将十六进制代码编码为字符串?
- python - 你如何检测乌龟窗口何时关闭
- excel - 带有用户表单的活动表
- php - 在 3 张图片之间填充 10px
- windows - 批量 FTP 上传:打开本地文件时出错
- amazon-web-services - 是否有任何不应该启用 AWS Compute Optimizer 的原因?