我正在嘗試將 webpack-encore 與 symfony 一起使用,但遇到問題。首先我用composer安裝了webpack-encore:composer require symfony/webpack-encore-bundleyarn install當(dāng)我嘗試運(yùn)行 encore 時(shí):node node_modules/.bin/encore production我收到此錯(cuò)誤:C:\wamp64\www\symfony1\node_modules\.bin\encore:2basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") ^^^^^^^SyntaxError: missing ) after argument list at wrapSafe (internal/modules/cjs/loader.js:1054:16) at Module._compile (internal/modules/cjs/loader.js:1102:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47我的操作系統(tǒng)是Windows 10,我相信Windows中的路徑有問題,但我不知道如何解決這個(gè)問題。有人能幫我嗎?
1 回答

哈士奇WWW
TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超6個(gè)贊
您可以嘗試用于 yarn encore prod
生產(chǎn)環(huán)境或 yarn encore dev
開發(fā)環(huán)境
對(duì)于開發(fā),您還可以使用: yarn encore dev --watch
如果您想自動(dòng)重新編譯您的資產(chǎn):
請(qǐng)參閱https://symfony.com/doc/current/frontend/encore/simple-example.html#configuring-encore-webpack
- 1 回答
- 0 關(guān)注
- 148 瀏覽
添加回答
舉報(bào)
0/150
提交
取消