algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.71k stars 520 forks source link

npm start do not work in examples/js/e-commerce on windows #5652

Open Zahid-epam opened 1 year ago

Zahid-epam commented 1 year ago

🐛 Current behavior

When running npm-start we are getting below error on windows systems BABEL_ENV' is not recognized as an internal or external command.

Suggested fix - add cross-env in package.json has fixed the issue.

🔍 Steps to reproduce

go to instantsearch-master\examples\js\e-commerce type npm install type npm start

error - BABEL_ENV' is not recognized as an internal or external command

Live reproduction

https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/instantsearch.js

💭 Expected behavior

Server should start at port 3000

Package version

1.15.0

Operating system

windows

Browser

chrome

Code of Conduct

Haroenv commented 1 year ago

What you should be able to do as a workaround is:

npm install  --save-dev cross-env

change package.json#script#start

"start": "cross-env BABEL_ENV=parcel parcel index.html --port 3000",
Zahid-epam commented 1 year ago

Thanks @Haroenv that was my suggested fix as well in the issue. But shouldn't this be updated in git as well?

Haroenv commented 1 year ago

You're actually the first person that has used these examples on Windows without WSL, so we weren't yet aware of the issue. I'll verify first if this is the only solution possible.