摘要:
昨天在编写博客的时候使用picgo剪切板图片上传功能的时候报错:
picgo工具报错内容为:A JavaScript error occurred in the main process Uncaught Exception: Error: spawn powershell ENOENT at Process. ChildProcess. handle. onexit(internal/child_process. js:264:19)
at onErrorNT(internal/child process. js:456:16)
at processTicksAndRejections (internal/process/task_queues, js:84:9)
Snipaste_2020-06-11_14-39-42.png
原因:
没有添加Powershell环境变量,因为PicGo的截图上传调用了powershell.exe,如果它不存在自然就无法调用了。
Snipaste_2020-06-11_14-47-34.png
解决方法:
添加C:\Windows\System32\WindowsPowerShell\v1.0到系统环境变量,重新启动PciGo.
Snipaste_2020-06-11_14-49-56.png