gpt4 book ai didi

javascript - uglifyjs - symfony assetic 转储, Node 路径

转载 作者:行者123 更新时间:2023-12-03 07:36:19 25 4
gpt4 key购买 nike

我可以在我的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com