Skip to content

NPM Global script fails #22

@tomootes

Description

@tomootes

I take the following steps;

npm install -g @developer-overheid-nl/don-checker@latest
npx @developer-overheid-nl/don-checker@latest validate --ruleset adr-20 --input ./openapi.json

This results in the following error:

import { extname } from "@stoplight/path";
^^^^^^^
SyntaxError: Named export 'extname' not found. The requested module '@stoplight/path' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@stoplight/path';
const { extname } = pkg;

Fix

I figured out that when I use node 24 (nvm use 24) the error is fixed (obviously because it accepts this type of importing).

Proper fix

I assume a lot of people use older versions of node (20.17.0 etc.). Can we fix this issue for them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions