[ERR_MODULE_NOT_FOUND]: Cannot find package 'tailwindcss' #13102

Closed
opened 2025-11-02 10:31:04 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @krosseyed on GitHub (Jun 4, 2024).

Description

I am running into an error when upgrading from v1.21.11 to v1.22.0. I cannot get my automated scripts to work on this version, but it works on other versions. The script is just a copy+paste from the upgrade docs.

Gitea Version

v1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Here is a text output of my terminal when running webpack

Screenshot 2024-06-04 at 2 22 35 PM

Git Version

v2.34.1

Operating System

Ubuntu 22.04 on ppcel64

How are you running Gitea?

I am building from source.

Database

SQLite

Originally created by @krosseyed on GitHub (Jun 4, 2024). ### Description I am running into an error when upgrading from v1.21.11 to v1.22.0. I cannot get my automated scripts to work on this version, but it works on other versions. The script is just a copy+paste from the upgrade docs. ### Gitea Version v1.22.0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots Here is a text output of my terminal when running webpack <img width="1036" alt="Screenshot 2024-06-04 at 2 22 35 PM" src="https://github.com/go-gitea/gitea/assets/6548354/3a6560c9-d6f5-461a-a386-c35276d39e72"> ### Git Version v2.34.1 ### Operating System Ubuntu 22.04 on ppcel64 ### How are you running Gitea? I am building from source. ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 10:31:04 -06:00
Author
Owner

@krosseyed commented on GitHub (Jun 4, 2024):

I noticed that the following command is not run before the script runs webpack

rm -rf public/assets/js public/assets/css public/assets/fonts public/assets/img/webpack

Do I need to do this before building from source?

@krosseyed commented on GitHub (Jun 4, 2024): I noticed that the following command is not run before the script runs webpack `rm -rf public/assets/js public/assets/css public/assets/fonts public/assets/img/webpack` Do I need to do this before building from source?
Author
Owner

@krosseyed commented on GitHub (Jun 4, 2024):

I also wanted to add my script to help with the troubleshooting process.

#!/bin/bash

# This script assumes you already have a working gitea instance

# Git Directory for Gitea
GIT_DIR="/home/ubuntu/gitea"

# Script warning
RED='\033[0;31m'
YEL='\033[0;33m'
NC='\033[0m' # No Color
printf "\n${RED}Please Note:${NC} ${YEL}You must set the GIT_DIR variable before running this script${NC}\n\n"
sleep 3

# Update git and npx
git -C $GIT_DIR pull
npm exec --prefix $GIT_DIR browserslist@latest --update-db

# User enters Gitea version
git -C $GIT_DIR tag -l
printf "\n${RED}Please Enter a Gitea Version${NC}\n\n"
read VERSION

# Checkout version and build for production
# This will stop and start the gitea service
service gitea stop
git -C $GIT_DIR checkout $VERSION
cd $GIT_DIR
TAGS="bindata sqlite" make build
service gitea start
printf "\n${YEL}You are now running on version:${NC}\n"
./gitea -version
@krosseyed commented on GitHub (Jun 4, 2024): I also wanted to add my script to help with the troubleshooting process. ``` #!/bin/bash # This script assumes you already have a working gitea instance # Git Directory for Gitea GIT_DIR="/home/ubuntu/gitea" # Script warning RED='\033[0;31m' YEL='\033[0;33m' NC='\033[0m' # No Color printf "\n${RED}Please Note:${NC} ${YEL}You must set the GIT_DIR variable before running this script${NC}\n\n" sleep 3 # Update git and npx git -C $GIT_DIR pull npm exec --prefix $GIT_DIR browserslist@latest --update-db # User enters Gitea version git -C $GIT_DIR tag -l printf "\n${RED}Please Enter a Gitea Version${NC}\n\n" read VERSION # Checkout version and build for production # This will stop and start the gitea service service gitea stop git -C $GIT_DIR checkout $VERSION cd $GIT_DIR TAGS="bindata sqlite" make build service gitea start printf "\n${YEL}You are now running on version:${NC}\n" ./gitea -version ```
Author
Owner

@silverwind commented on GitHub (Jun 4, 2024):

make build with environment variables of your choice is all that's needed. Make will do everything needed. In your case, I think node_modules got corrupted somehow, so I recommend doing rm -rf node_modules once and then try your script again.

Also, I would remove that npm exec, browserslist does not need constant updates and the one in 1.22 is pretty recent.

@silverwind commented on GitHub (Jun 4, 2024): `make build` with environment variables of your choice is all that's needed. Make will do everything needed. In your case, I think `node_modules` got corrupted somehow, so I recommend doing `rm -rf node_modules` once and then try your script again. Also, I would remove that `npm exec`, browserslist does not need constant updates and the one in 1.22 is pretty recent.
Author
Owner

@lunny commented on GitHub (Jun 5, 2024):

You should not run from source code in a production env. Just build a binary and run that binary.

@lunny commented on GitHub (Jun 5, 2024): You should not run from source code in a production env. Just build a binary and run that binary.
Author
Owner

@yp05327 commented on GitHub (Jun 6, 2024):

Maybe you need to check the permission of the user running this script.

stop and start service are all failed.

@yp05327 commented on GitHub (Jun 6, 2024): Maybe you need to check the permission of the user running this script. stop and start service are all failed.
Author
Owner

@krosseyed commented on GitHub (Jul 6, 2024):

Thanks @silverwind, that seemed to be the fix. I must have had a old bunch of node_packages over various gitea builds.

@krosseyed commented on GitHub (Jul 6, 2024): Thanks @silverwind, that seemed to be the fix. I must have had a old bunch of node_packages over various gitea builds.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13102