我喜欢在Docker环境中安装Akeneo。但是登录后,只有一个加载屏幕,什么也没有发生。在浏览器控制台中,显示以下错误:
app_dev.php:11 GET http://localhost:8080/dist/lib.min.js?2.3.8 net::ERR_ABORTED
app_dev.php:8 GET http://localhost:8080/css/pim.css?2.3.8 net::ERR_ABORTED
app_dev.php:21 GET http://localhost:8080/bundles/pimui/images/main-loader.gif 404 (Not Found)
app_dev.php:11 GET http://localhost:8080/dist/lib.min.js?2.3.8 404 (Not Found)
_math-scale.js:18 Uncaught Error: Cannot find module "/srv/pim/web/bundles/pimenrich/js/index.js"
at webpackMissingModule (_math-scale.js:18)
at Object.<anonymous> (_math-scale.js:18)
at __webpack_require__ (bootstrap ad15a36bb7cb156edceb:54)
at webpackJsonpCallback (bootstrap ad15a36bb7cb156edceb:25)
at main.min.js?2.3.8:1
因此,我尝试再次使用bin/docker/pim-front.sh
安装所有依赖项:
#!/usr/bin/env bash
docker-compose exec fpm rm -rf var/cache/*
docker-compose exec fpm bin/console --env=prod pim:installer:assets --symlink --clean
docker-compose run --rm node yarn run webpack-dev
但这会引发另一个错误:
$ bin/docker/pim-front.sh
Akeneo PIM assets
Dumping exposed routes.
[file+] /srv/pim/app/../web/js/routes.js
Installing assets as hard copies.
--- ------------------------ ----------------
Bundle Method / Error
--- ------------------------ ----------------
✔ FOSJsRoutingBundle copy
✔ OroAsseticBundle copy
✔ OroConfigBundle copy
✔ PimNavigationBundle copy
✔ PimUserBundle copy
✔ PimAnalyticsBundle copy
✔ PimDashboardBundle copy
✔ PimDataGridBundle copy
✔ PimEnrichBundle copy
✔ PimImportExportBundle copy
✔ PimNotificationBundle copy
✔ PimReferenceDataBundle copy
✔ PimUIBundle copy
--- ------------------------ ----------------
! [NOTE] Some assets were installed via copy. If you make changes to these assets you have to run this command again.
[OK] All assets were successfully installed.
Dumping all prod assets.
Debug mode is off.
Dumping all prod assets.
Debug mode is off.
14:58:01 [file+] /srv/pim/app/../web/css/pim.css
14:58:01 ERROR [console] Error thrown while running command "oro:assetic:dump --no-debug=1 --env=prod". Message: "The source file "/srv/pim/app/../web/bundles/pimdatagrid/lib/multiselect/jquery.multiselect.css" does not exist." ["error" => RuntimeException { …},"command" => "oro:assetic:dump --no-debug=1 --env=prod","message" => "The source file "/srv/pim/app/../web/bundles/pimdatagrid/lib/multiselect/jquery.multiselect.css" does not exist."] []
In FileAsset.php line 62:
The source file "/srv/pim/app/../web/bundles/pimdatagrid/lib/multiselect/jquery.multiselect.css" does not exist.
oro:assetic:dump [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<show-groups>] [<write_to>]
The command terminated with an error code: 1.
In CommandExecutor.php line 66:
The command terminated with an error code: 1.
oro:assetic:dump [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<show-groups>] [<write_to>]
此目录中不存在该文件。因为前面的命令将所有文件复制到 public/bundles
而不是 web/bundles
文件夹中。
是否可以配置目标目录?我认为,将文件复制到 web / bundles 文件夹中时,不会有任何错误。 手动复制无效,因为 web / bundles 文件夹在脚本执行期间已清除。