Currently attempting to construct my application with target: 'serverless'
set in the next.config.js
file (in order to deploy on AWS Lambda).
Upon running npm run build
, I am encountering the following output:
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://err.sh/next.js/built-in-css-disabled
info - Using external babel configuration from C:\Users\User\Desktop\mysite\.babelrc
info - Creating an optimized production build
warn - Compiled with warnings
./node_modules/require_optional/index.js
Critical dependency: the request of a dependency is an expression
... (similar errors listed)
> Build error occurred
Error: package.json does not exist at C:\package.json
at Object.module.exports.wr/F.exports.find ...
(... additional error logs)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `next build`
npm ERR! Exit status 1
npm ERR!
(... additional npm error log)
What could be the significance of this particular error?
Error: package.json does not exist at C:\package.json
Furthermore, how should one interpret all these Module not found: Can't resolve
errors that are showing up?
EDIT:
I do have a package.json
within the project folder.
When executing npm run dev
, it functions without any issues.
I'm perplexed as to why it's flagging C:\package.json
specifically
(Since the project resides under C:\Users\User\Desktop\mysite
)