Next.js Discord

Discord Forum

Help Error when build Production Environment Next.JS

Unanswered
Spectacled bear posted this in #help-forum
Open in Discord
Spectacled bearOP
I have issue with build production, the building error message=

"info - Linting and checking validity of types...
It looks like you're trying to use TypeScript but do not have the required package(s) installed.
Please install typescript and @types/node by running:
yarn add --dev typescript @types/node
If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn build" exited with 1

but the typescript and @types/node already on package.json.
anyway, this error just only on production, preview development no issue like this.

can someone explain why this hapend?

3 Replies

Bumping cause I don't know where this issue come from and I fail to fix it
maybe something with package-lock.json?
or using legacy-peer-deps?