lianginx / chatgpt-nuxt

基于 Nuxt.js 框架的 ChatGPT 类项目,支持 OpenAI 和 Azure 两种 API 切换,支持黑暗模式、中英日多语言切换。
https://ai.in-x.cc/
MIT License
216 stars 69 forks source link

ERR MODULE NOT FOUND #15

Closed lianginx closed 1 year ago

lianginx commented 1 year ago

I found an issue, after running yarn build, node .output/server/index.mjs will throw an error.

image

Originally posted by @lianginx in https://github.com/lianginx/chatgpt-nuxt/issues/13#issuecomment-1549020478

itTkm commented 1 year ago

@lianginx I'm also faced same issue when developping. I have fixed bellow steps:

rm -rf node-modules
rm yarn.lock
yarn
itTkm commented 1 year ago

@lianginx I have tested again with the following commands:

# remove old files
rm -rf node_modules .nuxt .output yarn.lock

# build & production preview
yarn && yarn build && yarn preview

# production
docker-compose up -d # Start and run in the background.
docker-compose down  # Stop and delete

It works fine in my environment.

lianginx commented 1 year ago

@lianginx I have tested again with the following commands:

# remove old files
rm -rf node_modules .nuxt .output yarn.lock

# build & production preview
yarn && yarn build && yarn preview

# production
docker-compose up -d # Start and run in the background.
docker-compose down  # Stop and delete

It works fine in my environment.

This method is effective, thank you very much. It seems that a bad influence was caused by the historical file.