Next.js Discord

Discord Forum

error while running npm run dev

Answered
Pillar posted this in #help-forum
Open in Discord
Answered by Peterbald
Please install 64bit nodejs or install nvm for node version manager
View full answer

88 Replies

Peterbald
Hi which node version are you using?
Is there package.json file on your project?
Please show me the project structure and package.json file if there is
v21.4.0
Peterbald
show me
ok
Peterbald
And show me the package.json file
So that I can check it out...
@Pillar Click to see attachment
maybe rename the folder name to something without space?
Peterbald
Did you create this project with create-next-app?
@Pillar Click to see attachment
oh you should cd next-app first
then npm run dev
i did that
Peterbald
Yeah cd to your project and then npm run dev
@Pillar i did that
type pwd in terminal
@Pillar i did that
Peterbald
Did you try it/.
again?
a sec
Path
----
D:\codes\next_js_code\next-app
Try to rename your folder to something whithout spaces so not A B C but rather ABC
Hahaha didn't see
the page is showing 404 error
have you installed this?
nah new lap
install itt
then run npm install again
got it
Peterbald
Please create project with create-next-app and try again
@Ray install itt
Peterbald
Hi @Ray
hi
Peterbald
I saw your many messages on help forum
I think you are an expert of Next.js...
oh i'm not lol
just trying to help
Peterbald
There is one word.
If you teach one thing to others then you have to learn ten things....
I think you are an expert...
âš  Attempted to load @next/swc-win32-ia32-msvc, but an error occurred: A dynamic link library (DLL) initialization routine failed.
\?\D:\codes\next_js_code\next-app\node_modules@next\swc-win32-ia32-msvc\next-swc.win32-ia32-msvc.node
⨯ Failed to load SWC binary for win32/ia32, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
same error
done
Peterbald
Try to remove node_module folders and package.json.lock file and install again
@Pillar done
still error?
@Pillar did
Peterbald
got same error?
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\codes\next_js_code\next-app\package.json
npm ERR! errno -4058
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open 'D:\codes\next_js_code\next-app\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in: C:\Users\neera\AppData\Local\npm-cache_logs\2023-12-24T15_55_07_036Z-debug-0.log
on running npm run dev
Peterbald
very werid
This is boilerplat project?
Directory: D:\codes\next_js_code\next-app


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 24-12-2023 21:22 .next
d----- 24-12-2023 20:01 public
da---- 24-12-2023 20:01 src
-a---- 24-12-2023 19:59 40 .eslintrc.json
-a---- 24-12-2023 19:59 391 .gitignore
-a---- 24-12-2023 19:59 201 next-env.d.ts
-a---- 24-12-2023 19:59 92 next.config.js
-a---- 24-12-2023 21:26 109 package-lock.json
-a---- 24-12-2023 19:59 1383 README.md
-a---- 24-12-2023 20:01 599 tsconfig.json
where is the package.json lol
just try init another package
it should work now
Peterbald
Haha I said to remove package-lock.json file, not package.json file lol
Please create next project with create-next-app and run
It will be work
@Ray where is the package.json lol
Peterbald
Shall I send DM to you?
should i use this
npx create-next-app@latest
@Pillar should i use this
Peterbald
Yes
@Peterbald Shall I send DM to you?
ok
created
next?
@Pillar next?
npm install && npm run dev
created
@Pillar Click to see attachment
there you go
wait
this popped
Peterbald
very weird
Install the node version as a 18 or 19 and try again
v20.10.0?
which c++ redistributable you got?
2015-2022
try npm install -D @next/swc-win32-ia32-msvc
ok i need to go i will try installing older version and i will tell here
@Pillar ok i need to go i will try installing older version and i will tell here
did you install 32bit or 64bit of nodejs?
install 64bit
Peterbald
Please install 64bit nodejs or install nvm for node version manager
Answer
Peterbald
And then you can install the any node version on your PC
yup running fine i have installed x86 in hurry just reinstalled and it is running without any errors thank you very mush for your time and effort