我正在Shopware 6中创建插件,所以我已经安装了此问题的“开发模板”参考
Shopware 6 Command './psh.phar administration:build.' is not working
在按照所有安装步骤操作后,当我打开前端时,它已损坏,因为后端工作正常。 broken front-end(image)
我发现“ ./psh.phar storefront:build”命令不起作用。它导致node.js错误,如下所示
/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/build/utils.js:116
} catch {
^
SyntaxError: Unexpected token {
at NativeCompileCache._moduleCompile (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/v8-compile-cache/v8-compile-cache.js:186:36)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at Object.<anonymous> (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/build/webpack.base.config.js:6:15)
at Module._compile (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at Object.<anonymous> (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/webpack.config.js:23:5)
at Module._compile (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at WEBPACK_OPTIONS (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/bin/utils/convert-argv.js:116:13)
at requireConfig (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/bin/utils/convert-argv.js:118:6)
at /var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/bin/utils/convert-argv.js:125:17
at Array.forEach (<anonymous>)
at module.exports (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/bin/utils/convert-argv.js:123:15)
at yargs.parse (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/bin/cli.js:71:45)
at Object.parse (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18)
at /var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/var/www/html/shopware6/vendor/shopware/platform/src/Storefront/Resources/node_modules/webpack-cli/bin/cli.js:365:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sw-next-storefront@1.0.0 production: `NODE_ENV=production webpack --config webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sw-next-storefront@1.0.0 production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/rahul/.npm/_logs/2019-09-24T09_05_58_383Z-debug.log
执行中止,子命令失败!
我认为解决这个问题可以解决前端损坏的错误。
答案 0 :(得分:1)
将node和npm更新到最新版本后,它现在可以正常工作了。我认为错误与nodejs有关。