I have uploaded nextjs code to cpanel and then trying to run app by npm run dev
but I am getting following error in next js.
[iamuser@conebar07 public_html]$ npm run dev
> next-demo-app@0.1.0 dev
> next dev -H mydomain.com -p 49000
ready - started server on nextappdomain.com:49000, url: http://nextappdomain.com:49000
info - Loaded env from /home/iamuser/public_html/.env
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/home'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/home'
Watchpack Error (watcher): Error: EACCES: permission denied, watch '/home'
Watchpack Error (initial scan): Error: EACCES: permission denied, scandir '/home'
event - compiled client and server successfully in 8s (170 modules)
wait - compiling...
event - compiled successfully in 82 ms (134 modules)
wait - compiling...
event - compiled successfully in 51 ms (36 modules)
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
It's simple next js app. There is no additional settings added. It's working perfectly in my windows local system. Also can not find any watchpack related setting in app. Do I just need to update permission for home directory in cpanel or is there any way to change watchpack path in app?
I found the temporary workaround. This error only occurs when I run command from cpanel terminal but if I run this command by connecting putty, it's working fine.