本文介绍了Saleor前端安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从github安装saleor前端软件包.文档已过时,尝试时会出现错误

I am trying to install saleor front-end package from github.The documentation is outdated and i get an error when i try

>>>nmp start
Error: Environment variable API_URI not set

我在不同的地方找到了此变量,但不知道要更改什么以及在哪里设置

I found this variable in different places but did not know what to change, and where to set it

已解决.以防万一有人遇到相同的问题在webpack> config.base.js

Solved.just in case somebody is going through the same problemin webpack>config.base.js

process.env.API_URI = 'http://localhost:8000/graphql/'

推荐答案

在Linux上,我通过在运行npm之前设置环境变量来解决此问题.开始于:

On Linux, I fixed this by setting environment variable before running npm; start with:

export API_URI=http://localhost:8000/graphql/

在终端上.

这篇关于Saleor前端安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 21:34