https://github.com/mongodb-js/mongosh
这个项目没法正常构建成功
[root@7178d402c4f2 mongosh]# npm run compile-exec
> mongosh@ precompile-exec /opt/mongosh
> npm run compile-cli
> mongosh@ compile-cli /opt/mongosh
> lerna run compile-ts --scope @mongosh/cli-repl --include-dependencies
lerna notice cli v4.0.0
lerna notice filter including "@mongosh/cli-repl"
lerna notice filter including dependencies
lerna info filter [ '@mongosh/cli-repl' ]
lerna info Executing command in 16 packages: "npm run compile-ts"
lerna info run Ran npm script 'compile-ts' in '@mongosh/errors' in 13.8s:
> @mongosh/errors@0.0.0-dev.0 compile-ts /opt/mongosh/packages/errors
> tsc -p tsconfig.json
lerna info run Ran npm script 'compile-ts' in '@mongosh/types' in 16.1s:
> @mongosh/types@0.0.0-dev.0 compile-ts /opt/mongosh/packages/types
> tsc -p tsconfig.json
lerna info run Ran npm script 'compile-ts' in '@mongosh/history' in 16.2s:
> @mongosh/history@0.0.0-dev.0 compile-ts /opt/mongosh/packages/history
> tsc -p tsconfig.json
lerna info run Ran npm script 'compile-ts' in '@mongosh/i18n' in 13.9s:
> @mongosh/i18n@0.0.0-dev.0 compile-ts /opt/mongosh/packages/i18n
> tsc -p tsconfig.json
lerna ERR! npm run compile-ts exited 2 in '@mongosh/service-provider-core'
lerna ERR! npm run compile-ts stdout:
> @mongosh/service-provider-core@0.0.0-dev.0 compile-ts /opt/mongosh/packages/service-provider-core
> tsc -p tsconfig.json
src/all-fle-types.ts(15,8): error TS2307: Cannot find module 'mongodb-client-encryption' or its corresponding type declarations.
src/all-fle-types.ts(17,33): error TS2307: Cannot find module 'mongodb-client-encryption' or its corresponding type declarations.
lerna ERR! npm run compile-ts stderr:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @mongosh/service-provider-core@0.0.0-dev.0 compile-ts: `tsc -p tsconfig.json`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @mongosh/service-provider-core@0.0.0-dev.0 compile-ts script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-27T19_43_19_567Z-debug.log
lerna ERR! npm run compile-ts exited 2 in '@mongosh/service-provider-core'
lerna WARN complete Waiting for 4 child processes to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mongosh@ compile-cli: `lerna run compile-ts --scope @mongosh/cli-repl --include-dependencies`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mongosh@ compile-cli script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-27T19_43_19_682Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mongosh@ precompile-exec: `npm run compile-cli`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mongosh@ precompile-exec script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-27T19_43_19_715Z-debug.log
[root@7178d402c4f2 mongosh]# cat /root/.npm/_logs/2022-06-27T19_43_19_682Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'compile-cli' ]
2 info using npm@6.14.12
3 info using node@v14.16.1
4 verbose run-script [ 'precompile-cli', 'compile-cli', 'postcompile-cli' ]
5 info lifecycle mongosh@~precompile-cli: mongosh@
6 info lifecycle mongosh@~compile-cli: mongosh@
7 verbose lifecycle mongosh@~compile-cli: unsafe-perm in lifecycle true
8 verbose lifecycle mongosh@~compile-cli: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/mongosh/node_modules/.bin:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/mongosh/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle mongosh@~compile-cli: CWD: /opt/mongosh
10 silly lifecycle mongosh@~compile-cli: Args: [
10 silly lifecycle '-c',
10 silly lifecycle 'lerna run compile-ts --scope @mongosh/cli-repl --include-dependencies'
10 silly lifecycle ]
11 silly lifecycle mongosh@~compile-cli: Returned: code: 2 signal: null
12 info lifecycle mongosh@~compile-cli: Failed to exec compile-cli script
13 verbose stack Error: mongosh@ compile-cli: `lerna run compile-ts --scope @mongosh/cli-repl --include-dependencies`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid mongosh@
15 verbose cwd /opt/mongosh
16 verbose Linux 4.19.190-6.lns8.loongarch64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "compile-cli"
18 verbose node v14.16.1
19 verbose npm v6.14.12
20 error code ELIFECYCLE
21 error errno 2
22 error mongosh@ compile-cli: `lerna run compile-ts --scope @mongosh/cli-repl --include-dependencies`
22 error Exit status 2
23 error Failed at the mongosh@ compile-cli script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
[root@7178d402c4f2 mongosh]# npm install mongodb-client-encryption
> mongodb-client-encryption@2.1.0 install /opt/mongosh/node_modules/mongodb-client-encryption
> prebuild-install --runtime napi --tag-prefix node-v || node-gyp rebuild
prebuild-install warn install No prebuilt binaries found (target=4 runtime=napi arch=loong64 libc= platform=linux)
make: Entering directory '/opt/mongosh/node_modules/mongodb-client-encryption/build'
CXX(target) Release/obj.target/mongocrypt/src/mongocrypt.o
../src/mongocrypt.cc: In constructor ‘node_mongocrypt::MongoCrypt::MongoCrypt(const Napi::CallbackInfo&)’:
../src/mongocrypt.cc:407:14: error: ‘mongocrypt_setopt_encrypted_field_config_map’ was not declared in this scope
if (!mongocrypt_setopt_encrypted_field_config_map(_mongo_crypt.get(), encryptedFieldsMapBinary.get())) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/mongocrypt.cc:407:14: note: suggested alternative: ‘mongocrypt_setopt_crypto_hooks’
if (!mongocrypt_setopt_encrypted_field_config_map(_mongo_crypt.get(), encryptedFieldsMapBinary.get())) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongocrypt_setopt_crypto_hooks
../src/mongocrypt.cc:456:9: error: ‘mongocrypt_setopt_bypass_query_analysis’ was not declared in this scope
mongocrypt_setopt_bypass_query_analysis(_mongo_crypt.get());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/mongocrypt.cc:456:9: note: suggested alternative: ‘mongocrypt_setopt_schema_map’
mongocrypt_setopt_bypass_query_analysis(_mongo_crypt.get());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongocrypt_setopt_schema_map
../src/mongocrypt.cc:459:5: error: ‘mongocrypt_setopt_use_need_kms_credentials_state’ was not declared in this scope
mongocrypt_setopt_use_need_kms_credentials_state(_mongo_crypt.get());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/mongocrypt.cc:459:5: note: suggested alternative: ‘mongocrypt_setopt_append_csfle_search_path’
mongocrypt_setopt_use_need_kms_credentials_state(_mongo_crypt.get());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongocrypt_setopt_append_csfle_search_path
../src/mongocrypt.cc: In member function ‘Napi::Value node_mongocrypt::MongoCrypt::CSFLEVersionInfo(const Napi::CallbackInfo&)’:
../src/mongocrypt.cc:468:32: error: ‘mongocrypt_csfle_version’ was not declared in this scope
uint64_t version_numeric = mongocrypt_csfle_version(_mongo_crypt.get());
^~~~~~~~~~~~~~~~~~~~~~~~
../src/mongocrypt.cc:468:32: note: suggested alternative: ‘mongocrypt_version’
uint64_t version_numeric = mongocrypt_csfle_version(_mongo_crypt.get());
^~~~~~~~~~~~~~~~~~~~~~~~
mongocrypt_version
../src/mongocrypt.cc:469:34: error: ‘mongocrypt_csfle_version_string’ was not declared in this scope
const char* version_string = mongocrypt_csfle_version_string(_mongo_crypt.get(), nullptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/mongocrypt.cc:469:34: note: suggested alternative: ‘mongocrypt_version’
const char* version_string = mongocrypt_csfle_version_string(_mongo_crypt.get(), nullptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongocrypt_version
../src/mongocrypt.cc: In member function ‘void node_mongocrypt::MongoCryptContext::ProvideKMSProviders(const Napi::CallbackInfo&)’:
../src/mongocrypt.cc:745:5: error: ‘mongocrypt_ctx_provide_kms_providers’ was not declared in this scope
mongocrypt_ctx_provide_kms_providers(_context.get(), kms_bson.get());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/mongocrypt.cc:745:5: note: suggested alternative: ‘mongocrypt_setopt_kms_providers’
mongocrypt_ctx_provide_kms_providers(_context.get(), kms_bson.get());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongocrypt_setopt_kms_providers
make: *** [mongocrypt.target.mk:105: Release/obj.target/mongocrypt/src/mongocrypt.o] Error 1
make: Leaving directory '/opt/mongosh/node_modules/mongodb-client-encryption/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 4.19.190-6.lns8.loongarch64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/mongosh/node_modules/mongodb-client-encryption
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"loong64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/mocha/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"loong64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/@parcel/watcher/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"loong64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mongodb-client-encryption@2.1.0 install: `prebuild-install --runtime napi --tag-prefix node-v || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mongodb-client-encryption@2.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-27T19_50_01_572Z-debug.log