Can't install with nest.js
RostyslavKhrinovskyi opened this issue · comments
Rostyslav Khrinovskyi commented
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:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: require() of ES modules is not supported.
Andrey Sitnik commented
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.