Closed klaude closed 7 months ago
Any update on this? It seems https://github.com/stoplightio/spectral/releases/download/v6.11.0/spectral-linux-arm64 (v6.11.0
) still returns the same error. I'm running spectral inside a Docker container of an image that curls the above package:
pkg/prelude/bootstrap.js:1876
throw error;
^
Error: Cannot find module '/snapshot/project/node_modules/tslib/tslib.js'
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
at createEsmNotFoundErr (node:internal/modules/cjs/loader:967:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:960:15)
at resolveExports (node:internal/modules/cjs/loader:488:14)
at Module._findPath (node:internal/modules/cjs/loader:528:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:932:27)
at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
at Module._load (node:internal/modules/cjs/loader:787:27)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at Module.require (pkg/prelude/bootstrap.js:1855:31)
at require (node:internal/modules/cjs/helpers:102:18) {
code: 'MODULE_NOT_FOUND',
path: '/snapshot/project/node_modules/tslib/package.json',
pkg: true
}
Node.js v18.5.0
make: *** [lint_apis] Error 1
Please update npm in those latest packages and re release.
Hi, @P0lip. The new 6.11 binaries look great! Thanks for the fix in #2569.
Glad it worked! Apologies it took so long
Describe the bug
Hello, Spectral folks. 👋 I receive the error "Error: Cannot find module '/snapshot/project/node_modules/tslib/tslib.js'" when executing the macos-arm64 binary at https://github.com/stoplightio/spectral/releases/tag/v6.10.0 . The full error is:
The error happens on releases for 6.8.0 and 6.9.0 as well. I have also run into this error when running
spectral-alpine-arm64
from an Alpine container. I suspect the problem has been here since arm64 releases were published starting with the 6.8.0 release.Also to note, I had to sign the macOS release via
codesign --sign - ./spectral-macos-arm64
to prevent my kernel from killing the program.Thanks for looking and for the help!
To Reproduce
codesign
if you're on a macExpected behavior
I expect to receive a usage statement since I'm not passing in any command arguments:
Environment
Additional context
I originally introduced arm64 builds in #2492.
pkg
execution worked fine locally on my macOS laptop. Looking at e9edd2efa0532d62de11a5cd7ebc95ec6bd139f4's build,pkg
executed with no error, but there are a large number of warnings in the build's output:There are 5,472 instances of these "Failed to make bytecode node18-arm64" warnings. I suspect this is the problem.
I was unable to reproduce the same build warnings following the same build steps in docker locally with CircleCI's
cimg/node:lts
container. The only differences between my setup and CircleCI's are the container runtime and that I don't have yarn dependencies cached.I can see if I can reproduce the same warnings and debug
pkg
, but if y'all have seen this before and know a quick fix then I'd be grateful. Thanks again for checking this out!