Symfony2 Assetic:无法解析节点可执行文件的路径 [英] Symfony2 Assetic: Path to node executable could not be resolved
问题描述
在运行应用程序/控制台 assetic:dump 时,我得到:
When running app/console assetic:dump, I am getting:
无法解析节点可执行文件的路径
Path to node executable could not be resolved
这是什么意思以及如何解决这个问题?
What does it mean and how to fix this?
尝试通过 app_dev.php 浏览项目时,当浏览器尝试下载 css 和 js 文件时,我收到 HTTP 500 错误.
When trying to browse project via app_dev.php, I am getting an HTTP 500 errors when browser tries to download css and js files.
推荐答案
首先确保你已经安装了 node 并找到 node 的路径.您通常可以通过使用 which node
来找到它,它会返回类似 /usr/local/bin/node
的内容.如果它返回类似 /usr/bin/which: no node in ...
你需要安装 node.
First make sure you have node installed and find the path to node. You can usually find this by using which node
which will return something like /usr/local/bin/node
. If it returns something like /usr/bin/which: no node in ...
you need to install node.
接下来配置symfony.打开您的 config.yml (./app/config/config.yml) 和资产配置的节点路径,即:
Next configure symfony. Open your config.yml (./app/config/config.yml) and the path to node to you assetic config, i.e.:
# app/config/config.yml
assetic:
node: /usr/local/bin/node
这篇关于Symfony2 Assetic:无法解析节点可执行文件的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!