Saleor front-end installation

*爱你&永不变心* 提交于 2020-07-22 11:05:33

问题


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

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

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

回答1:


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

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

on the terminal.




回答2:


create a file in the root directory of /saleor-storefront called ".env" and write inside:

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

This will create an environment variable called API_URI with the value 'http://localhost:8000/graphql/'



来源:https://stackoverflow.com/questions/60210676/saleor-front-end-installation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!