【问题标题】:Module not found: Error: Cannot resolve 'file' or 'directory' ../../找不到模块:错误:无法解析“文件”或“目录”../../
【发布时间】:2019-07-08 05:37:23
【问题描述】:

我是 nodejs 的新手,在我的 hybris 项目中,首先我安装了 nodejs,运行“npm install”、“npm i cross-env”命令,当我从 node_module 文件夹运行命令“npm run hybris”时,我得到了有些错误,您可以提供任何解决方案。

C:\Atlas_Insta\hybris\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop>npm run hybris

> RodanAndFields@1.0.0 hybris C:\Atlas_Insta\hybris\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop
> cross-env NODE_ENV=production gulp hybris-build

[15:29:07] Using gulpfile C:\Atlas_Insta\hybris\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop\gulpfile.js
[15:29:07] Starting 'clean'...
[15:29:07] Finished 'clean' after 128 ms
[15:29:07] Starting 'markupCompile'...
[15:29:08] Starting 'sass'...
[15:29:09] Finished 'sass' after 615 ms
[15:29:09] Starting 'js'...
[15:29:09] Finished 'js' after 129 ms
[15:29:09] Starting 'copy-img'...
[15:29:09] Finished 'copy-img' after 584 μs
[15:29:09] Starting 'copy-fonts'...
[15:29:09] Finished 'copy-fonts' after 597 μs
[15:29:09] Starting 'copy-api'...
[15:29:09] Finished 'copy-api' after 630 μs
[15:29:09] Starting 'read-templates'...
[15:29:09] Finished 'read-templates' after 1.87 ms
All templates written successfully!
[15:29:32] Version: webpack 1.15.0
  Asset     Size  Chunks             Chunk Names
 app.js  1.19 MB       0  [emitted]  app
app.map  9.63 MB       0  [emitted]  app

ERROR in C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/order-summary/order-summary.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../../../../_ui/frontend/js/analytics/analytics-eventmap-r2 in C:\Atlas_Repo\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop\web/webroot/WEB-INF/r2/fe-components\checkout\order-summary
 @ C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/order-summary/order-summary.js 23:30-103

ERROR in C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/checkout-form-billing/checkout-form-billing.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../../../../_ui/frontend/js/analytics/analytics-config-r2 in C:\Atlas_Repo\bin\custom\rodanandfields\rodanandfieldsstorefront\FE-Develop\web/webroot/WEB-INF/r2/fe-components\checkout\checkout-form-billing
 @ C:/Atlas_Repo/bin/custom/rodanandfields/rodanandfieldsstorefront/FE-Develop/web/webroot/WEB-INF/r2/fe-components/checkout/checkout-form-billing/checkout-form-billing.js 23:22-93

【问题讨论】:

    标签: node.js user-interface npm hybris


    【解决方案1】:

    您使用的是哪个 Hybris 版本?我对 hybris 6.6 有一个 smilar 问题。在我切换到节点 v6.14.3 后它对我有用,我使用的是更新的节点和更新的 npm 版本。

    我在 npmancillary 扩展的文件夹中找到了这个版本

    ext-content/npmancillary/resources/npm/node

    【讨论】:

      猜你喜欢
      • 2017-06-19
      • 2016-02-03
      • 2017-05-07
      • 2017-10-15
      • 2016-11-18
      • 2016-06-10
      • 2017-12-28
      • 2017-01-17
      相关资源
      最近更新 更多