Closed fdorantesm closed 1 year ago
looks like your package manager's lock file is broken because it has wrap-ansi
v8, which is a ESM-only package (see yarn why wrap-ansi
).
After rm yarn.lock && yarn install
everything went fine here.
Not work for me for a deployment on Heroku I've tried
"engines": {
"node": "16.17",
"yarn": "1.22.19
}
And
Add engine node & yarn version as local
rm yarn.lock && yarn install
push to git (git deployment method selected)
Not working..
Error on nest build
:
/tmp/build_ccf76b34/node_modules/inquirer/lib/utils/screen-manager.js:8
var stripAnsi = require('strip-ansi');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /tmp/build_ccf76b34/node_modules/strip-ansi/index.js from /tmp/build_ccf76b34/node_modules/inquirer/lib/utils/screen-manager.js not supported.
Instead change the require of index.js in /tmp/build_ccf76b34/node_modules/inquirer/lib/utils/screen-manager.js to a dynamic import() which is available in all CommonJS modules.
That worked for me, try removing the node_modules directory and yarn.lock, then install modules again.
Share a replicable repo if error persists.
Already tried :/ Isn't a local problem. It's a Heroku build problem I will create a replicate repo
Already tried :/ Isn't a local problem. It's a Heroku build problem I will create a replicate repo
Try cloning and install dependencies in a clean docker context.
looks like your package manager's lock file is broken because it has
wrap-ansi
v8, which is a ESM-only package (seeyarn why wrap-ansi
).After
rm yarn.lock && yarn install
everything went fine here.
@micalevisk I faced the same problem as the issue, and I solved it by referring to your comment. Thank you! But I don't know why the esm-only package breaks yarn.lock.
Can you explain it to me?
Is there an existing issue for this?
I found an error related with GraphQL module, that's not the same case.
Current behavior
When I try to start my application this error occures, I tried updating @nestjs/cli, node version, setting my package as module but it doesn't work.
Minimum reproduction code
https://github.com/fdorantesm/nestjs-mongodb-hexagonal-template/
Steps to reproduce
$ yarn
$ yarn start:dev
Expected behavior
Package
Other package
@nestjs/cli
NestJS version
9.4.2
Packages versions
Node.js version
16.16.0
In which operating systems have you tested?
Other
Using MacOS Ventura 13.4.1 (c) (22F770820d)