0

I'm attempting to create a new Next.js project on my local machine using the following command: npx create-next-app@latest . I've selected TypeScript, ESLint, Tailwind CSS, and other default options, but during the installation of dependencies, I encounter an ETIMEDOUT error. This error seems to be related to network connectivity, but I'm not behind a proxy, and my internet connection appears stable.

I tried re-running the command, expecting the issue to resolve itself, but the problem persisted.

I was expecting the command to create a new Next.js project without any issues, but instead, it keeps failing with the same ETIMEDOUT error and takes so much time to install the packages.

Error message

> npx create-next-app@latest .
√ Would you like to use TypeScript? ... No / Yes
√ Would you like to use ESLint? ... No / Yes
√ Would you like to use Tailwind CSS? ... No / Yes
√ Would you like to use `src/` directory? ... No / Yes
√ Would you like to use App Router? (recommended) ... No / Yes
√ Would you like to customize the default import alias? ... No / Yes
Creating a new Next.js app in C:\Personal\VSCode\Websites\Next JS\first-next-js-app.

Using npm.

Initializing project with template: app-tw


Installing dependencies:
- react
- react-dom
- next
- typescript
- @types/react
- @types/node
- @types/react-dom
- tailwindcss
- postcss
- autoprefixer
- eslint
- eslint-config-next

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz failed, reason: connect ETIMEDOUT 2606:4700::6810:822:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-08-19T17_56_23_859Z-debug-0.log

Aborting installation.
  npm install --save-exact --save react react-dom next typescript @types/react @types/node @types/react-dom tailwindcss postcss autoprefixer eslint eslint-config-next has failed.

Windows specifications

  • Edition Windows 10 Pro
  • Version 22H2
  • Installed on ‎1/‎18/‎2022
  • OS build 19045.3324
  • Experience Windows Feature Experience Pack 1000.19041.1000.0
Omar Afet
  • 23
  • 3

2 Answers2

0

Do you have your local and global .npm file contents you can post here? Also check network adapter and connection.

0

It finally worked for me after the third attempt, it took 33 minutes to install.

> npx create-next-app@latest .
√ Would you like to use TypeScript? ... No / Yes
√ Would you like to use ESLint? ... No / Yes
√ Would you like to use Tailwind CSS? ... No / Yes
√ Would you like to use `src/` directory? ... No / Yes
√ Would you like to use App Router? (recommended) ... No / Yes
√ Would you like to customize the default import alias? ... No / Yes
Creating a new Next.js app in C:\Personal\VSCode\Websites\Next JS\first-next-js-app.

Using npm.

Initializing project with template: app-tw


Installing dependencies:
- react
- react-dom
- next
- typescript
- @types/react
- @types/node
- @types/react-dom
- tailwindcss
- postcss
- autoprefixer
- eslint
- eslint-config-next


added 326 packages, and audited 327 packages in 33m

117 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Initialized a git repository.

Success! Created first-next-js-app at C:\Personal\VSCode\Websites\Next JS\first-next-js-app
Omar Afet
  • 23
  • 3