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
I recently noticed that the Spectral Linting tool is no longer working when running the extractor, see errors I'm getting below.
I'm using Azure DevOps agents with Ubuntu 22.04.4 to run the pipeline.
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.237.1
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
spectral lint --format stylish --format junit --output.junit /home/vsts/work/1/a/spectral-result.xml /home/vsts/work/1/a/artifacts/apis/**/specification.{json,yaml,yml} -r https://raw.githubusercontent.com/connectedcircuits/devops-api-linter/main/rules.yaml
========================== Starting Command Output ===========================
[command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/61ee25b7-04cb-4fce-80e0-123aed7526ea.sh
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'node:url'
Require stack:
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/runtime/uri.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/core.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/ajv.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/spectral.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/commands/lint.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/runtime/uri.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/core.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/ajv.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/spectral.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/commands/lint.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/index.js'
]
}
##[error]Bash exited with code '1'.
##[error]Bash wrote one or more lines to the standard error stream.
##[error]internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'node:url'
Require stack:
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/runtime/uri.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/core.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/ajv.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/spectral.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/commands/lint.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/runtime/uri.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/core.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/ajv.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/spectral.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/commands/lint.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/index.js'
]
}
throw err;
^
Error: Cannot find module 'node:url'
Require stack:
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/runtime/uri.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/core.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/ajv.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/spectral.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/index.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/commands/lint.js
- /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/fast-uri/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/runtime/uri.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/core.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/ajv/dist/ajv.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/spectral.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/node_modules/@stoplight/spectral-core/dist/index.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/commands/lint.js',
'/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@stoplight/spectral-cli/dist/index.js'
]
}
##[section]Finishing: Run Spectral Linting
I think the issue come from the version of Node that the pipeline is using (v12.x).
I tried to use the LTS version of Node (v20.x) and it fixes the issue.
I propose to update the version of Node used in the azdo pipeline to v20.x, I'll create a PR for that.
Expected behavior
We should have the result of the Spectral Lint displayed in the logs.
Actual behavior
Spectral lint doesn't run.
Reproduction Steps
Launch the Extractor pipeline and check the result of Run Spectral Linting step
The text was updated successfully, but these errors were encountered:
Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.
Release version
v5.1.4
Describe the bug
Hello,
I recently noticed that the Spectral Linting tool is no longer working when running the extractor, see errors I'm getting below.
I'm using Azure DevOps agents with Ubuntu 22.04.4 to run the pipeline.
I think the issue come from the version of Node that the pipeline is using (v12.x).
I tried to use the LTS version of Node (v20.x) and it fixes the issue.
I propose to update the version of Node used in the azdo pipeline to v20.x, I'll create a PR for that.
Expected behavior
We should have the result of the Spectral Lint displayed in the logs.
Actual behavior
Spectral lint doesn't run.
Reproduction Steps
Launch the Extractor pipeline and check the result of Run Spectral Linting step
The text was updated successfully, but these errors were encountered: