Closed RostyslavKhrinovskyi closed 1 year ago
Node version: v14.17.6 Nest.js version: 9.0.0
after simple install npm i nanoid and import by import { nanoid } from 'nanoid' trying to ran application and get next error:
npm i nanoid
import { nanoid } from 'nanoid'
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: require() of ES modules is not supported.
Nest.js doesn’t support ESM applications. Switch to 3.x branch for now (4.x branch is only for ESM applications).
Don’t worry, 3.x branch is not outdated and still supported.
Node version: v14.17.6 Nest.js version: 9.0.0
after simple install
npm i nanoid
and import byimport { nanoid } from 'nanoid'
trying to ran application and get next error:Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: require() of ES modules is not supported.