Unverified Commit c1dbc126 authored by Eungyeol's avatar Eungyeol Committed by GitHub

Do not have the required package error fix (#28662)

The following error occurred 
when I created a project with the typecript template of createp-next-app 
and did the 'next build'.

```shell
It looks like you're trying to use TypeScript but do not have the required package(s) installed.

Please install @types/node by running:

        yarn add --dev @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).
```

This issue was resolved by adding @types/node.
So I added @types/node to the devDependencies of the create-next-app typecript template.
parent 501bfe69
...@@ -226,7 +226,7 @@ export async function createApp({ ...@@ -226,7 +226,7 @@ export async function createApp({
* TypeScript projects will have type definitions and other devDependencies. * TypeScript projects will have type definitions and other devDependencies.
*/ */
if (typescript) { if (typescript) {
devDependencies.push('typescript', '@types/react') devDependencies.push('typescript', '@types/react', '@types/node')
} }
/** /**
* Install package.json dependencies if they exist. * Install package.json dependencies if they exist.
......
...@@ -143,6 +143,7 @@ describe('create next app', () => { ...@@ -143,6 +143,7 @@ describe('create next app', () => {
'react-dom', 'react-dom',
]) ])
expect(Object.keys(pkgJSON.devDependencies)).toEqual([ expect(Object.keys(pkgJSON.devDependencies)).toEqual([
'@types/node',
'@types/react', '@types/react',
'eslint', 'eslint',
'eslint-config-next', 'eslint-config-next',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment