我正在嘗試將 webpack-encore 與 symfony 一起使用,但遇到問題。首先我用composer安裝了webpack-encore:composer require symfony/webpack-encore-bundleyarn install當我嘗試運行 encore 時:node node_modules/.bin/encore production我收到此錯誤: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我的操作系統是Windows 10,我相信Windows中的路徑有問題,但我不知道如何解決這個問題。有人能幫我嗎?
1 回答

哈士奇WWW
TA貢獻1799條經驗 獲得超6個贊
您可以嘗試用于 yarn encore prod
生產環境或 yarn encore dev
開發環境
對于開發,您還可以使用: yarn encore dev --watch
如果您想自動重新編譯您的資產:
請參閱https://symfony.com/doc/current/frontend/encore/simple-example.html#configuring-encore-webpack
- 1 回答
- 0 關注
- 154 瀏覽
添加回答
舉報
0/150
提交
取消