【问题标题】:Saleor-Storefront Error when running 'npm start'运行“npm start”时的 Saleor-Storefront 错误
【发布时间】:2020-08-24 13:13:04
【问题描述】:

尝试在 ubuntu 上安装 saleor storefront。

运行后

npm 开始 得到以下错误

npm start

> saleor-site@2.10.0-rc.1 start /home/nsola/storefront
> cross-env NODE_ENV=develop webpack-dev-server --history-api-fallback --watch --port 3000 --mode development --hotOnly

Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
ℹ 「wds」: Project is running at http://localhost:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to /index.html
ℹ 「wdm」: wait until bundle finished: /
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! saleor-site@2.10.0-rc.1 start: `cross-env NODE_ENV=develop webpack-dev-server --history-api-fallback --watch --port 3000 --mode development --hotOnly`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the saleor-site@2.10.0-rc.1 start 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 cache clean --force

第2步:通过$ rm -rf node_modules package-lock.json文件夹删除node_modules或通过进入目录并右键单击>删除/移动到垃圾箱手动删除它。另外,也删除 package-lock.json 文件。

第三步:npm install

重新开始,$ npm start

但没有帮助。

节点版本:v12.16.3 NPM 版本:6.14.4 nginx版本:nginx/1.14.0 (Ubuntu)

当我在本地安装它时,它运行良好,没有任何问题

【问题讨论】:

    标签: node.js npm npm-install npm-start saleor


    【解决方案1】:

    对于任何试图解决这个问题的人 - 我的解决方案是增加内存大小。我在我的 ubuntu 18.04x64 droplet 上运行 1GB RAM。但是在将其增加到 4GB RAM 之后。一切都没有错误。

    另一种解决方案是将“npm run build-assets”拆分为需要低内存系统的较小步骤。

    【讨论】:

      【解决方案2】:

      通过您的笔记本电脑构建它,然后部署到远程服务器。

      https://github.com/mirumee/saleor-storefront/issues/654#issuecomment-601150996

      ...但我会说您应该使用 npm run build 在本地编译所有内容,然后将 dist 目录推送到 Heroku 并从那里提供应用程序。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-11-19
        • 1970-01-01
        • 2020-07-02
        • 2021-01-01
        • 1970-01-01
        • 2021-12-18
        • 2020-07-19
        • 2020-02-04
        相关资源
        最近更新 更多