问题描述
我正在尝试在 PHPStorm 中添加一个文件观察器来自动压缩我的 js 文件.我遵循了本教程,但出现以下错误:
I'm trying to add a filewatcher in PHPStorm to automatically compress my js files. I followed this tutorial but i have these errors:
cmd.exe /D /C C:/Users/Sofiane/node_modules/.bin/yuicompressor.cmd reglements.js >-o reglements.min.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)
Process finished with exit code 8
不太懂,第一次用Node.js
I don't really understand, it's the first time I use Node.js
感谢您的帮助!
推荐答案
该错误通常意味着 child_process.spawn 抛出 ENOENT,因为找不到可执行文件.尝试将 java.exe 的路径添加到您的系统路径 - 有帮助吗?另一种解决方案是在文件观察程序(而不是 yuicompressor.cmd)中指定一个指向 node_modules\yuicompressor\build\yuicompressor-2.4.8.jar 的路径
The error usually means that child_process.spawn threw ENOENT because the executable couldn't be found. Try adding a path to java.exe to your system PATH - does it help? Another solution is to specify a path to node_modules\yuicompressor\build\yuicompressor-2.4.8.jar as a program in file watchers (instead of yuicompressor.cmd)
这篇关于YUI 压缩器和 PHPStorm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!