任何人都可以帮助修复我安装isolated-vm时的错误吗?

问题描述 投票:0回答:2

我在 Debian 11 上安装 npm 包隔离虚拟机时遇到以下错误: https://www.npmjs.com/package/isolated-vm

日志对我没有多大帮助...

npm ERR! code 1
npm ERR! path /home/screeps/screeps-server/node_modules/isolated-vm
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild --release -j 4
npm ERR! make: Entering directory '/home/screeps/screeps-server/node_modules/isolated-vm/build'
npm ERR!   CXX(target) Release/obj.target/nortti/src/external_copy/serializer_nortti.o
npm ERR!   CXX(target) Release/obj.target/nortti/src/isolate/allocator_nortti.o
npm ERR!   AR(target) Release/obj.target/nortti.a
npm ERR!   COPY Release/nortti.a
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/external_copy/external_copy.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/external_copy/serializer.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/external_copy/string.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/environment.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/executor.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/holder.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/inspector.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/platform_delegate.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/scheduler.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/stack_trace.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/three_phase_task.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/lib/thread_pool.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/lib/timer.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/callback.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/context_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/evaluation.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/external_copy_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/isolate.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/isolate_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/lib_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/module_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/native_module_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/reference_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/script_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/session_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/transferable.o
npm ERR!   SOLINK_MODULE(target) Release/obj.target/isolated_vm.node
npm ERR! make: Leaving directory '/home/screeps/screeps-server/node_modules/isolated-vm/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/screeps/screeps-server/node_modules/isolated-vm/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/screeps/.cache/node-gyp/12.22.5/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/screeps/.cache/node-gyp/12.22.5',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/screeps/.cache/node-gyp/12.22.5/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/screeps/screeps-server/node_modules/isolated-vm',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 4 ]
npm ERR! ../src/isolate/environment.cc:25: warning: "_GNU_SOURCE" redefined
npm ERR!    25 | #define _GNU_SOURCE
npm ERR!       |
npm ERR! <command-line>: note: this is the location of the previous definition
npm ERR! ../src/module/lib_handle.cc: In member function 'v8::Local<v8::Value> ivm::LibHandle::PrivateSymbol(v8::MaybeLocal<v8::String>)':
npm ERR! ../src/module/lib_handle.cc:58:10: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
npm ERR!    58 |  return *reinterpret_cast<Local<Value>*>(&symbol);
npm ERR!       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/module/lib_handle.cc:58:10: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
npm ERR! /usr/bin/ld: cannot find -lbrotlidec
npm ERR! /usr/bin/ld: cannot find -lbrotlienc
npm ERR! /usr/bin/ld: cannot find -lcares
npm ERR! /usr/bin/ld: cannot find -lnghttp2
npm ERR! /usr/bin/ld: cannot find -licui18n
npm ERR! /usr/bin/ld: cannot find -licuuc
npm ERR! /usr/bin/ld: cannot find -licudata
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make: *** [isolated_vm.target.mk:229: Release/obj.target/isolated_vm.node] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
npm ERR! gyp ERR! System Linux 4.19.0
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "4"
npm ERR! gyp ERR! cwd /home/screeps/screeps-server/node_modules/isolated-vm
npm ERR! gyp ERR! node -v v12.22.5
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/screeps/.npm/_logs/2022-05-03T11_59_47_268Z-debug-0.log

之后我无法打开日志,因为该文件夹已被删除。

库中必须有一些东西: lbrotlidec, lbrotlienc

有什么想法,如何解决这个问题吗?

node.js linux npm debian npm-install
2个回答
1
投票

检查您当前使用的 NodeJS 版本是否与您尝试安装的isolated-vm 版本兼容。

https://www.npmjs.com/package/isolated-vm#requirements

例如,我试图安装另一个库,并且遇到类似的错误,我的节点版本是16,将其降级到12并且不再出现错误。


0
投票

有同样的问题:

npm 我隔离虚拟机 npm 错误!代码1 npm 错误!路径 /Users/PapiNathooni/Desktop/LifeBandJournal/create-scrypto-dapp/client/node_modules/isolated-vm npm 错误!命令失败 npm 错误!命令 sh -c 预构建安装 || (节点 gyp 重建 --release -j 4 && 节点 gyp 清理) npm 错误!预构建安装警告安装无法获取本地颁发者证书 npm 错误! gyp info 如果以 ok 结尾则有效 npm 错误!使用 [电子邮件受保护] 获取 gyp 信息 npm 错误!使用 [电子邮件受保护] | gyp 信息达尔文 | ARM64 npm 错误! gyp info 使用 Python 版本 3.11.5 查找 Python,位于“/Library/Frameworks/Python.framework/Versions/3.11/bin/python3” npm 错误! gyp http GET https://nodejs.org/download/release/v20.8.1/node-v20.8.1-headers.tar.gz npm 错误! gyp WARN 安装出错,回滚安装 npm 错误!吉普 错误!配置错误 npm 错误!吉普 错误! stack FetchError:请求https://nodejs.org/download/release/v20.8.1/node-v20.8.1-headers.tar.gz失败,原因:无法获取本地颁发者证书 npm 错误!吉普 错误!堆栈在 ClientRequest 处。 (/opt/homebrew/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14) npm 错误!吉普 错误! ClientRequest.emit 处的堆栈(节点:事件:514:28) npm 错误!吉普 错误!堆栈位于 TLSSocket.socketErrorListener (节点:_http_client:495:9) npm 错误!吉普 错误! TLSSocket.emit 处的堆栈(节点:事件:526:35) npm 错误!吉普 错误!堆栈位于emitErrorNT(节点:内部/流/销毁:151:8) npm 错误!吉普 错误!堆栈位于emitErrorCloseNT(节点:内部/流/销毁:116:3) npm 错误!吉普 错误!堆栈位于 process.processTicksAndRejections (节点:内部/进程/task_queues:82:21) npm 错误!吉普 错误!系统达尔文22.3.0 npm 错误!吉普 错误!命令“/opt/homebrew/Cellar/node/20.8.1/bin/node”“/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js”“重建”“- -释放”“-j”“4” npm 错误!吉普 错误! cwd /Users/PapiNathooni/Desktop/LifeBandJournal/create-scrypto-dapp/client/node_modules/isolated-vm npm 错误!吉普 错误!节点-v v20.8.1 npm 错误!吉普 错误!节点 gyp -v v9.4.0 npm 错误!吉普 错误!不好

npm 错误!此运行的完整日志可以在以下位置找到:/Users/PapiNathooni/.npm/_logs/2023-10-18T22_37_57_196Z-debug-0.log

除了“检查你的 Node 版本”之外,似乎没有任何有用的答案,这对我来说效果很好。

© www.soinside.com 2019 - 2024. All rights reserved.