为了账号安全,请及时绑定邮箱和手机立即绑定

无法在 Windows 上运行 webpack-encore

无法在 Windows 上运行 webpack-encore

PHP
芜湖不芜 2024-01-19 15:31:04
我正在尝试将 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


查看完整回答
反对 回复 2024-01-19
  • 1 回答
  • 0 关注
  • 28 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信