我已经以与此处相同的方式将 Browsershot 安装到 Laravel
( https://github.com/spatie/browsershot ),当我尝试执行某些操作时,它会出现此错误。
The command "node "C:\xp\htdocs\staticit\vendor\spatie\browsershot\src/../bin/browser.js" "{\"url\":\"https://google.com\",\"action\":\"screenshot\",\"options\":{\"type\":\"png\",\"path\":\"C:\xp\htdocs\staticit\app\Http\Controllers/temp/testScreenshot.png\",\"args\":[],\"viewport\":{\"width\":800,\"height\":600}}}"" failed. Exit Code: 1(General error) Working directory: C:\xp\htdocs\staticit\public Output: ================ Error Output: ================ 'node' is not recognized as an internal or external command, operable program or batch file.
我已经在 Laravel 项目根文件夹中安装了 Node 模块,当我在 cmd 中写入 node -v 时,它会被识别。
**注意:我使用的是Win7、Laravel 5.7和node、php最新版本。
最佳答案
所以问题是我的操作系统是 Windows,当我切换到 Ubunto 时一切都工作正常。我已经在创建者的 github 存储库中打开了这个问题,但他关闭了它,因为他不使用 Windows。
关于php - “node”不被识别为内部或外部命令、可操作程序或批处理文件。 - 浏览器截图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51890956/