如何解决无法在Windows上运行webpack-encore
我正在尝试将webpack-encore与symfony一起使用,但是遇到了问题。 首先,我使用composer安装了webpack-encore:
composer require symfony/webpack-encore-bundle
yarn install
当我尝试使用以下方法进行再演时:
node node_modules/.bin/encore production
我收到此错误:
C:\wamp64\www\symfony1\node_modules\.bin\encore:2
basedir=$(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:1
0)
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_ma
in.js:71:12)
at internal/main/run_main_module.js:17:47
我的操作系统是Windows 10,我相信Windows中的路径存在问题,但是我不知道如何解决此问题。有人可以帮我吗?
解决方法
您可以尝试使用
yarn encore prod
用于生产环境
要么
yarn encore dev
用于开发环境
对于开发,您还可以使用:
yarn encore dev --watch
如果您想自动重新编译您的资产:
请参阅https://symfony.com/doc/current/frontend/encore/simple-example.html#configuring-encore-webpack
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。