运行“ npm start”时,Saleor-Storefront错误

时间:2020-05-08 21:23:01

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

尝试在ubuntu上安装销售店面

运行后

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:

尝试过: 步骤1:$ npm cache clean --force

第2步:通过$ rm -rf node_modules package-lock.json文件夹删除node_modules或通过进入目录并右键单击>删除/移至回收站手动将其删除。另外,也删除package-lock.json文件。

第3步:npm install

要重新开始,$ npm start

但是没有帮助。

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

当我在本地安装它时,它运行正常,没有问题

2 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分:0)

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

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

<块引用>

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