v2rockets / Loyal-Elephie

Your Trusty Memory-enabled AI Companion - Simple RAG chatbot optimized for local LLMs | 12 Languages Supported | OpenAI API Compatible
MIT License
236 stars 19 forks source link

Support WINDOWS #3

Open win10ogod opened 4 months ago

win10ogod commented 4 months ago

Support WINDOWS

PS F:\Loyal-Elephie\frontend> npm start

> ai-chatbot-starter@0.1.0 start
> PORT=8080 next start

'PORT' is not recognized as an internal or external command,
operable program or batch file.
v2rockets commented 4 months ago

Hey, some quick solutions from GPT:

Method 1: Using cross-env

The cross-env package allows you to set environment variables across different platforms in a consistent way. First, you need to install cross-env:

npm install cross-env --save-dev

Then, modify your package.json script to use cross-env:

"scripts": {
  "start": "cross-env PORT=8080 next start"
}

Method 2: Using set Command in Windows

If you prefer not to use an additional package, you can modify your package.json to use the set command, which is recognized by Windows:

"scripts": {
  "start": "set PORT=8080 && next start"
}
Pointeh commented 4 months ago

That seems to have fixed it for me, the following line: "start": "set PORT=8080 && next start"