P粉7926739582023-08-14 09:42:51
Diagnose Next.js installation process and failures and next build failures. An installation process that works in a crash
Preflight a) Open permissions to avoid permission restrictions and failures b) If permissions are an issue, set permissions to Everybody, User, etc. on Windows or Mac c) Check for anti-virus software issues (anti-virus software may block files)
Install
Path Repair
Problem: NEXT BUILD REACT ERROR and NEXT BUILD installation errors **However, there is a problem, next.js installs the project in the directory where the create-next-app command is run (Of course). But'next build'There is a problem
Let’s look at two paths a) C:\Users\peema\Documents\alert\peeapp\node_modules b) C:\Users\peema\node_modules*
The project is installed in the peeapp folder, so node_modules (C:\Users\peema\Documents\alert\peeapp\node_modules), but (next build) calls the second Paths (C:\Users\peema\node_modules)
So, packages like react, next and others cannot be found because they are not in the second path but are installed in the first path.
solution: Copy all packages that are not in the first node_modules to the second location so they can be found.