Issues with Google Fonts Import and Directory Removal in Next.js
Answered
CHEEMDA MAN posted this in #help-forum
Hi, I'm having trouble importing Google Fonts from next/google/font. Is anyone else experiencing the same issue? Additionally, I'm encountering a "Failed to remove some directories" error, and I'm unsure why my app is failing after this issue arose following the layout structure changes in Next.js. Any suggestions on how to resolve these problems?
70 Replies
send a screenshot of your code
@gin send a screenshot of your code
module not found issue
are u importing it correctly
from 'next/font/google'u dont need to install it
its already bundled into next
@gin u dont need to install it
importing
@CHEEMDA MAN i was importing it like
next/google/font
yeah that was the issue
but what with second issue
i'm creating next app using this
npx create-next-appi'm creating next app using this
with @latest behind it?
npx create-next-app@latest
umm no
yeah do that
okay let me try
@gin yeah do that
Installing devDependencies:
- postcss
- tailwindcss
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup 'C:\Users\cheem\Downloads\Visual_code\Personal-Work\24x7tour\node_modules\@next\swc-win32-x64-msvc',
npm warn cleanup [Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\cheem\Downloads\Visual_code\Personal-Work\24x7tour\node_modules@next\swc-win32-x64-msvc'] {
npm warn cleanup errno: -4051,
npm warn cleanup code: 'ENOTEMPTY',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\Users\cheem\Downloads\Visual_code\Personal-Work\24x7tour\node_modules\@next\swc-win32-x64-msvc'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
- postcss
- tailwindcss
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup 'C:\Users\cheem\Downloads\Visual_code\Personal-Work\24x7tour\node_modules\@next\swc-win32-x64-msvc',
npm warn cleanup [Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\cheem\Downloads\Visual_code\Personal-Work\24x7tour\node_modules@next\swc-win32-x64-msvc'] {
npm warn cleanup errno: -4051,
npm warn cleanup code: 'ENOTEMPTY',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\Users\cheem\Downloads\Visual_code\Personal-Work\24x7tour\node_modules\@next\swc-win32-x64-msvc'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
do it in a new folder
okay let me try
little bit same
delete your older folder
um okay
@CHEEMDA MAN um okay
u a probably installing into the same directory
but create next app initialises a complete new project for u
@gin but create next app initialises a complete new project for u
now i'm creating it in /test/ which is completly new in downloads
@gin in the setup
not getting
your point
nah nothing
so completely new folder?
delete package-lock.json
Answer
and node modules
then npm i?
@CHEEMDA MAN then npm i?
yeah but before that
show me your package.json
ok looks good
now run npm i
okay
@gin now run npm i
thankyou bro it working good now
but can i know what was the issue with my packages?
probably some weird cache issue
okay thankyou brother
np
@CHEEMDA MAN okay thankyou brother
make sure to mark this post as solved
u can mark my message as solution
@gin u can mark my message as solution
oh okay okay
how to do that like i'm new to discordf
like this
ok ok
thanks
have a nice day
same to you brother