Closed joshxyzhimself closed 2 years ago
I'm guessing your CI/CD server is out memory. Please reopen w/o the AWS SDK dependencies if it's still an issie
Hi @laverdet, it's not a CI/CD server, it's a freshly installed Ubuntu Desktop 22.04.
I tried on a new folder, same results. May you reopen the issue?
user@device:~/Documents/test$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help init` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (test)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /home/user/Documents/test/package.json:
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this OK? (yes) yes
user@device:~/Documents/test$ npm install isolated-vm
npm ERR! code 1
npm ERR! path /home/user/Documents/test/node_modules/isolated-vm
npm ERR! command failed
npm ERR! command sh /tmp/install-c4d403d0.sh
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2022-08-06T08_27_20_155Z-debug-0.log
user@device:~/Documents/test$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
user@device:~/Documents/test$ node -v
v18.7.0
user@device:~/Documents/test$ npm -v
8.15.0
user@device:~/Documents/test$ gcc --version
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
user@device:~/Documents/test$ cat /home/user/.npm/_logs/2022-08-06T08_27_20_155Z-debug-0.log
0 verbose cli /snap/node/6553/bin/node /snap/node/6553/bin/npm
1 info using npm@8.15.0
2 info using node@v18.7.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/snap/node/6553/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/user/Documents/test/.npmrc Completed in 0ms
10 timing config:load:project Completed in 14ms
11 timing config:load:file:/home/user/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/snap/node/6553/etc/npmrc Completed in 2ms
14 timing config:load:global Completed in 2ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 2ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 24ms
19 timing npm:load:configload Completed in 24ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm install isolated-vm
23 verbose argv "install" "isolated-vm"
24 timing npm:load:setTitle Completed in 2ms
25 timing config:load:flatten Completed in 3ms
26 timing npm:load:display Completed in 5ms
27 verbose logfile logs-max:10 dir:/home/user/.npm/_logs
28 verbose logfile /home/user/.npm/_logs/2022-08-06T08_27_20_155Z-debug-0.log
29 timing npm:load:logFile Completed in 5ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 39ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile start cleaning logs, removing 1 files
35 silly logfile done cleaning log files
36 timing arborist:ctor Completed in 0ms
37 timing idealTree:init Completed in 16ms
38 timing idealTree:userRequests Completed in 3ms
39 silly idealTree buildDeps
40 silly fetch manifest isolated-vm@*
41 http fetch GET 200 https://registry.npmjs.org/isolated-vm 1530ms (cache revalidated)
42 silly placeDep ROOT isolated-vm@4.4.1 OK for: test@1.0.0 want: *
43 timing idealTree:#root Completed in 1545ms
44 timing idealTree:node_modules/isolated-vm Completed in 0ms
45 timing idealTree:buildDeps Completed in 1547ms
46 timing idealTree:fixDepFlags Completed in 0ms
47 timing idealTree Completed in 1568ms
48 timing reify:loadTrees Completed in 1569ms
49 timing reify:diffTrees Completed in 1ms
50 silly reify moves {}
51 timing reify:retireShallow Completed in 2ms
52 timing reify:createSparse Completed in 1ms
53 timing reify:loadBundles Completed in 0ms
54 silly audit bulk request { 'isolated-vm': [ '4.4.1' ] }
55 timing reifyNode:node_modules/isolated-vm Completed in 95ms
56 timing reify:unpack Completed in 95ms
57 timing reify:unretire Completed in 0ms
58 timing build:queue Completed in 2ms
59 info run isolated-vm@4.4.1 install node_modules/isolated-vm node-gyp rebuild --release -j 4
60 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 307ms
61 timing auditReport:getReport Completed in 309ms
62 silly audit report {}
63 timing auditReport:init Completed in 0ms
64 timing reify:audit Completed in 309ms
65 info run isolated-vm@4.4.1 install { code: 1, signal: null }
66 timing reify:rollback:createSparse Completed in 22ms
67 timing reify:rollback:retireShallow Completed in 0ms
68 timing command:install Completed in 1925ms
69 verbose stack Error: command failed
69 verbose stack at ChildProcess.<anonymous> (/snap/node/6553/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
69 verbose stack at ChildProcess.emit (node:events:513:28)
69 verbose stack at maybeClose (node:internal/child_process:1091:16)
69 verbose stack at Socket.<anonymous> (node:internal/child_process:449:11)
69 verbose stack at Socket.emit (node:events:513:28)
69 verbose stack at Pipe.<anonymous> (node:net:757:14)
70 verbose pkgid isolated-vm@4.4.1
71 verbose cwd /home/user/Documents/test
72 verbose Linux 5.15.0-43-generic
73 verbose node v18.7.0
74 verbose npm v8.15.0
75 error code 1
76 error path /home/user/Documents/test/node_modules/isolated-vm
77 error command failed
78 error command sh /tmp/install-c4d403d0.sh
79 verbose exit 1
80 timing npm Completed in 2059ms
81 verbose unfinished npm timer reify 1659774440290
82 verbose unfinished npm timer reify:build 1659774441978
83 verbose unfinished npm timer build 1659774441978
84 verbose unfinished npm timer build:deps 1659774441978
85 verbose unfinished npm timer build:run:install 1659774441980
86 verbose unfinished npm timer build:run:install:node_modules/isolated-vm 1659774441981
87 verbose code 1
88 error A complete log of this run can be found in:
88 error /home/user/.npm/_logs/2022-08-06T08_27_20_155Z-debug-0.log
And I have 12 gb ram
Thanks for the information. Can you try cloning the repro and building manually? There's no output from the build command which is strange.
Something like: git clone https://[...] cd isolated-vm npx node-gyp --rebuild
I'm not at a computer so you may have to tinker a bit for the exact commands
Sure sure, results:
user@device:~/Documents$ git clone git@github.com:laverdet/isolated-vm.git
Cloning into 'isolated-vm'...
remote: Enumerating objects: 4047, done.
remote: Counting objects: 100% (703/703), done.
remote: Compressing objects: 100% (240/240), done.
remote: Total 4047 (delta 470), reused 682 (delta 459), pack-reused 3344
Receiving objects: 100% (4047/4047), 1.09 MiB | 809.00 KiB/s, done.
Resolving deltas: 100% (3067/3067), done.
user@device:~/Documents$ cd isolated-vm/
user@device:~/Documents/isolated-vm$ npm install
npm ERR! code 1
npm ERR! path /home/user/Documents/isolated-vm
npm ERR! command failed
npm ERR! command sh /tmp/install-b3d7dc5c.sh
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2022-08-06T21_31_49_163Z-debug-0.log
user@device:~/Documents/isolated-vm$ npx node-gyp --rebuild
Need to install the following packages:
node-gyp@9.1.0
Ok to proceed? (y) y
Usage: node-gyp <command> [options]
where <command> is one of:
- build - Invokes `make` and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates a Makefile for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version
node-gyp@9.0.0 /snap/node/6553/lib/node_modules/npm/node_modules/node-gyp
node@18.7.0
user@device:~/Documents/isolated-vm$ npx node-gyp --rebuild
Usage: node-gyp <command> [options]
where <command> is one of:
- build - Invokes `make` and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates a Makefile for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version
node-gyp@9.0.0 /snap/node/6553/lib/node_modules/npm/node_modules/node-gyp
node@18.7.0
Did this build properly?
user@device:~/Documents/isolated-vm$ npx node-gyp rebuild --release -j 4
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@18.7.0 | linux | x64
gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v18.7.0/node-v18.7.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v18.7.0/node-v18.7.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v18.7.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v18.7.0/SHASUMS256.txt
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/snap/node/6553/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/user/Documents/isolated-vm/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/snap/node/6553/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/user/.cache/node-gyp/18.7.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/user/.cache/node-gyp/18.7.0',
gyp info spawn args '-Dnode_gyp_dir=/snap/node/6553/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/user/.cache/node-gyp/18.7.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/user/Documents/isolated-vm',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 4 ]
make: Entering directory '/home/user/Documents/isolated-vm/build'
CXX(target) Release/obj.target/nortti/src/external_copy/serializer_nortti.o
CXX(target) Release/obj.target/nortti/src/isolate/allocator_nortti.o
AR(target) Release/obj.target/nortti.a
COPY Release/nortti.a
CXX(target) Release/obj.target/isolated_vm/src/external_copy/external_copy.o
CXX(target) Release/obj.target/isolated_vm/src/external_copy/serializer.o
CXX(target) Release/obj.target/isolated_vm/src/external_copy/string.o
CXX(target) Release/obj.target/isolated_vm/src/isolate/environment.o
../src/isolate/environment.cc:25: warning: "_GNU_SOURCE" redefined
25 | #define _GNU_SOURCE
|
<command-line>: note: this is the location of the previous definition
CXX(target) Release/obj.target/isolated_vm/src/isolate/executor.o
CXX(target) Release/obj.target/isolated_vm/src/isolate/holder.o
CXX(target) Release/obj.target/isolated_vm/src/isolate/inspector.o
CXX(target) Release/obj.target/isolated_vm/src/isolate/platform_delegate.o
CXX(target) Release/obj.target/isolated_vm/src/isolate/scheduler.o
CXX(target) Release/obj.target/isolated_vm/src/isolate/stack_trace.o
CXX(target) Release/obj.target/isolated_vm/src/isolate/three_phase_task.o
CXX(target) Release/obj.target/isolated_vm/src/lib/thread_pool.o
CXX(target) Release/obj.target/isolated_vm/src/lib/timer.o
CXX(target) Release/obj.target/isolated_vm/src/module/callback.o
CXX(target) Release/obj.target/isolated_vm/src/module/context_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/evaluation.o
CXX(target) Release/obj.target/isolated_vm/src/module/external_copy_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/isolate.o
CXX(target) Release/obj.target/isolated_vm/src/module/isolate_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/lib_handle.o
../src/module/lib_handle.cc: In member function ‘v8::Local<v8::Value> ivm::LibHandle::PrivateSymbol(v8::MaybeLocal<v8::String>)’:
../src/module/lib_handle.cc:58:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
58 | return *reinterpret_cast<Local<Value>*>(&symbol);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/module/lib_handle.cc:58:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
CXX(target) Release/obj.target/isolated_vm/src/module/module_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/native_module_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/reference_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/script_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/session_handle.o
CXX(target) Release/obj.target/isolated_vm/src/module/transferable.o
SOLINK_MODULE(target) Release/obj.target/isolated_vm.node
COPY Release/isolated_vm.node
COPY ../out/isolated_vm.node
TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/user/Documents/isolated-vm/build'
gyp info ok
user@device:~/Documents/isolated-vm$ ls -al ./build/
total 68
drwxrwxr-x 3 user user 4096 Aug 7 05:35 .
drwxrwxr-x 11 user user 4096 Aug 7 05:36 ..
-rw-rw-r-- 1 user user 1082 Aug 7 05:35 action_after_build.target.mk
-rw-rw-r-- 1 user user 145 Aug 7 05:35 binding.Makefile
-rw-rw-r-- 1 user user 14175 Aug 7 05:35 config.gypi
-rw-rw-r-- 1 user user 7051 Aug 7 05:35 isolated_vm.target.mk
-rw-rw-r-- 1 user user 13293 Aug 7 05:35 Makefile
-rw-rw-r-- 1 user user 5573 Aug 7 05:35 nortti.target.mk
drwxrwxr-x 5 user user 4096 Aug 7 05:36 Release
user@device:~/Documents/isolated-vm$ ls -al ./build/Release
total 25508
drwxrwxr-x 5 user user 4096 Aug 7 05:36 .
drwxrwxr-x 3 user user 4096 Aug 7 05:35 ..
drwxrwxr-x 3 user user 4096 Aug 7 05:35 .deps
-rwxrwxr-x 3 user user 24066488 Aug 7 05:36 isolated_vm.node
-rw-rw-r-- 2 user user 2030738 Aug 7 05:35 nortti.a
drwxrwxr-x 4 user user 4096 Aug 7 05:36 obj.target
drwxrwxr-x 2 user user 4096 Aug 7 05:36 out
user@device:~/Documents/isolated-vm$ ls -al ./build/Release/out
total 12
drwxrwxr-x 2 user user 4096 Aug 7 05:36 .
drwxrwxr-x 5 user user 4096 Aug 7 05:36 ..
-rw-rw-r-- 1 user user 203 Aug 7 05:36 isolated_vm.node.d
Could it be because on package.json it is
node-gyp rebuild --release -j 4
instead of
npx node-gyp rebuild --release -j 4
?
Forked it here: https://github.com/joshxyzhimself/isolated-vm
Applied the changes in package.json here: https://github.com/joshxyzhimself/isolated-vm/commit/cb980068c1394423c8c52bc3d75607fcca588199
Installed successfully here:
Currently stuck here
user@device:~/Documents/jxyz$ node ./ivm.mjs
node:internal/modules/cjs/loader:1204
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: /snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/user/Documents/jxyz/node_modules/isolated-vm/out/isolated_vm.node)
at Module._extensions..node (node:internal/modules/cjs/loader:1204:18)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1022:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/user/Documents/jxyz/node_modules/isolated-vm/isolated-vm.js:1:18)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12) {
code: 'ERR_DLOPEN_FAILED'
}
Node.js v18.7.0
So the error above looks for GLIBCXX_3.4.29
Because it is not in /snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6
user@device:~/Documents/jxyz$ strings /snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_DEBUG_MESSAGE_LENGTH
First of all I don't know how the fuck it reached snap folder hahaha.
I checked my installed version, it says it's latest
user@device:~/Documents/jxyz$ sudo apt install libstdc++6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libstdc++6 is already the newest version (12-20220319-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
user@device:~/Documents/jxyz$ /sbin/ldconfig -p | grep stdc++
libstdc++.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libstdc++.so.6
libstdc++.so.6 (libc6) => /lib/i386-linux-gnu/libstdc++.so.6
It also has the GLIBCXX_3.4.29
we are looking for.
user@device:~/Documents/jxyz$ strings /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30
GLIBCXX_DEBUG_MESSAGE_LENGTH
So my question is, how do I make it load from /lib/x86_64-linux-gnu/libstdc++.so.6
instead from /snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6
?
I'll update if I find solutions :rocket:
Tried this from here, no luck
user@device:~/Documents/jxyz$ LD_PRELOAD='/lib/x86_64-linux-gnu/libstdc++.so.6' node ./ivm.mjs
/snap/node/6553/bin/node: /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /lib/x86_64-linux-gnu/libstdc++.so.6)
/snap/node/6553/bin/node: /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /lib/x86_64-linux-gnu/libstdc++.so.6)
/snap/node/6553/bin/node: /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /lib/x86_64-linux-gnu/libstdc++.so.6)
// @ts-check
import * as ivm from 'isolated-vm';
const isolate = new ivm.Isolate({ memoryLimit: 8 });
const context = isolate.createContextSync();
const jail = context.global;
jail.setSync('global', jail.derefInto());
jail.setSync('log', (...args) => {
console.log(...args);
});
context.evalSync('log("hello world")');
user@device:~/Documents/jxyz$ LD_PRELOAD='/lib/x86_64-linux-gnu/libstdc++.so.6 /lib/x86_64-linux-gnu/libc.so.6' node ./ivm.mjs
Segmentation fault (core dumped)
user@device:~/Documents/jxyz$ LD_PRELOAD="/lib/x86_64-linux-gnu/libstdc++.so.6 /lib/x86_64-linux-gnu/libc.so.6" node ./ivm.mjs
Segmentation fault (core dumped)
Stuck figuring out how to make it load from /lib/x86_64-linux-gnu/libstdc++.so.6
instead from /snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6
lol
Any ideas?
Re: npx node-gyp
this isn't needed in npm scripts because npm will set your $PATH correctly. The fact that npx changes the behavior in your case leads me to believe something truly horrible has happened to your system configuration. I might start troubleshooting by making a package.json with { "scripts": { "test": "echo $PATH" } }
and find out why node-gyp isn't in this PATH. That may give you a lead on at least one issue.
Your issue with GLIBCXX_3.4.29
is almost certainly related. isolated-vm does not require a GLIBCXX version that high. Here is what I see on my system:
marcel@serv ~/tmp/node_modules/isolated-vm $ strings out/isolated_vm.node | egrep ^GLIBCXX | sort -V
GLIBCXX_3.4
GLIBCXX_3.4.9
GLIBCXX_3.4.11
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.21
GLIBCXX_3.4.22
This makes me think the headers you're compiling against are different than the libraries you're linking to. Again, I think something awful has happened to your computer.
Found the fix lads
I encountered the same installation problems when I was trying to install puppeteer so I suspected it's my Node & NPM.
I uninstalled from Snap: https://snapcraft.io/node
I reinstalled from nodesource: https://github.com/nodesource/distributions#debinstall
Puppeteer now works. Isolated VM now works.
// @ts-check
import { default as ivm } from 'isolated-vm';
const isolate = new ivm.Isolate({ memoryLimit: 8 });
const context = isolate.createContextSync();
const jail = context.global;
jail.setSync('global', jail.derefInto());
jail.setSync('log', (...args) => {
console.log(...args);
});
context.evalSync('log("hello world")');
user@device:~/Documents/project$ node ./ivm.mjs
hello world