You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ npm i -g @stoplight/spectral-cli
$ type spectral
spectral is hashed (~/.nvm/versions/node/v12.18.3/bin/spectral)
running spectral yields an error:
$ spectral lint -r .spectral.yaml openapi.yaml
internal/modules/cjs/loader.js:490
throw new ERR_PACKAGE_PATH_NOT_EXPORTED(basePath, mappingKey);
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './presets/node' is not defined by "exports" in ~/.nvm/versions/node/v12.18.3/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-ruleset-bundler/package.json
at applyExports (internal/modules/cjs/loader.js:490:9)
at resolveExports (internal/modules/cjs/loader.js:506:23)
at Function.Module._findPath (internal/modules/cjs/loader.js:634:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:27)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (~/.nvm/versions/node/v12.18.3/lib/node_modules/@stoplight/spectral-cli/dist/services/linter/utils/getRuleset.js:13:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
and I get the same problem if I uninstall then install earlier versions such as
@stoplight/[email protected] and @stoplight/[email protected]
Only 6.0.0 works for me
$ spectral --version
6.0.0
The text was updated successfully, but these errors were encountered:
When I try to install latest
running
spectral
yields an error:and I get the same problem if I uninstall then install earlier versions such as
@stoplight/[email protected] and @stoplight/[email protected]
Only 6.0.0 works for me
The text was updated successfully, but these errors were encountered: