Skip to content

Can't run pix31 init #14

@claudiovallejo

Description

@claudiovallejo

I'm getting this error:

$ npx pix31 init
.../node_modules/pix31/dist/cli.js:10
var ora = require('ora');
          ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/c14mx/Dropbox/Mac (3)/Documents/dev/toshi/node_modules/pix31/node_modules/ora/index.js from /Users/c14mx/Dropbox/Mac (3)/Documents/dev/toshi/node_modules/pix31/dist/cli.js not supported.
Instead change the require of index.js in /Users/c14mx/Dropbox/Mac (3)/Documents/dev/toshi/node_modules/pix31/dist/cli.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/c14mx/Dropbox/Mac (3)/Documents/dev/toshi/node_modules/pix31/dist/cli.js:10:11) {
  code: 'ERR_REQUIRE_ESM'
}

And the relevant part of my package.json:

{
  "engines": {
    "node": ">=18.18.0",
    "npm": ">=9.0.0"
  },
  "scripts": {...},
  "dependencies": {
    ...
    "pix31": "^1.0.11",
    "react": "^18.2.0",
    "react-day-picker": "^8.10.1",
    "react-dom": "^18.2.0",
    "react-hook-form": "^7.54.2",
  },
  "devDependencies": {
    ...
    "typescript": "^5.7.3"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions