Error on npm run build
niklasgrewe opened this issue · comments
Niklas Grewe commented
When i create a brand new project and run npm run build
i get the following error:
/path/to/project/node_modules/@remix-run/dev/cli/create.js:26
var sortPackageJSON = require('sort-package-json');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/project/node_modules/sort-package-json/index.js from /path/to/project/node_modules/@remix-run/dev/cli/create.js not supported.
Instead change the require of index.js in /path/to/project/node_modules/@remix-run/dev/cli/create.js to a dynamic import() which is available in all CommonJS modules.
I took the following steps:
- create a new project
npx create-remix --template Girish21/speed-metal-stack
- run
npm run setup
- run
npm run build
i am using Node.js v17.2.0
Niklas Grewe commented
The error is apparently a bug in Remix and is already tracked here: remix-run/remix#3044