我可以在我的 ubuntu 开发服务器上本地使用 uglifyjs,但是当使用远程 Centos 机器进行生产时,我在运行时收到以下错误
$ php app/console assetic:dump
返回一个[RuntimeException]
Path to node executable could not be resolved.
我相信如果我运行,node 和 uglifyjs 都会安装
$ which node
/usr/bin/nodejs
$ which uglifyjs
/usr/bin/uglifyjs
我的config.yml
部分位于下面
# Assetic Configuration
assetic:
debug: "%kernel.debug%"
use_controller: false
bundles: [eventsBundle]
node: /usr/bin/nodejs
filters:
uglifyjs2:
# the path to the uglifyjs executable
bin: /usr/bin/uglifyjs
我也尝试过
...
bin: /usr/lib/node_modules/uglify-js
...
最佳答案
config.yml如下
# Assetic Configuration
assetic:
debug: "%kernel.debug%"
use_controller: "%kernel.debug%"
bundles: [eventsBundle]
filters:
uglifyjs2:
# the path to the uglifyjs executable
bin: /usr/bin/uglifyjs
在终端中首次运行
$ php app/console cache:clear --env=prod
然后
$ php app/console assetic:dump --env=prod
关于javascript - uglifyjs - symfony assetic 转储, Node 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35601043/