laverdet / isolated-vm

Secure & isolated JS environments for nodejs
ISC License
2.19k stars 154 forks source link

Can't install on macOS (external_copy/serializer_nortti.o is not an object file (not allowed in a library)) #425

Open ice3 opened 1 year ago

ice3 commented 1 year ago

Hello, I try to install in MacOS and get this. It's a fresh node install. npm install isolated-vm fails.

It's unclear from the log and an internet search what I'm missing.

Environment:

node -v v20.9.0
node-gyp -v v9.4.0

(base) ➜  ~ system_profiler SPSoftwareDataType
Software:
    System Software Overview:
      System Version: macOS 14.1.1 (23B81)
      Kernel Version: Darwin 23.1.0
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
(base) ➜  ~ npm install isolated-vm
npm ERR! code 1
npm ERR! path /Users/mfalce/node_modules/isolated-vm
npm ERR! command failed
npm ERR! command sh -c prebuild-install || (node-gyp rebuild --release -j 4 && node-gyp clean)
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!   LIBTOOL-STATIC Release/nortti.a
npm ERR! prebuild-install warn install No prebuilt binaries found (target=20.9.0 runtime=node arch=arm64 libc= platform=darwin)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.9.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.13 found at "/Users/mfalce/anaconda3/bin/python3"
npm ERR! gyp info spawn /Users/mfalce/anaconda3/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@20/20.9.0/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   '/Users/mfalce/node_modules/isolated-vm/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@20/20.9.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/mfalce/Library/Caches/node-gyp/20.9.0/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=/Users/mfalce/Library/Caches/node-gyp/20.9.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/Cellar/node@20/20.9.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/mfalce/Library/Caches/node-gyp/20.9.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/mfalce/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! error: libtool: file: Release/obj.target/nortti/src/external_copy/serializer_nortti.o is not an object file (not allowed in a library)
npm ERR! error: libtool: file: Release/obj.target/nortti/src/isolate/allocator_nortti.o is not an object file (not allowed in a library)
npm ERR! make: *** [Release/nortti.a] 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 (/opt/homebrew/Cellar/node@20/20.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Darwin 23.1.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node@20/20.9.0/bin/node" "/opt/homebrew/Cellar/node@20/20.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "4"
npm ERR! gyp ERR! cwd /Users/mfalce/node_modules/isolated-vm
npm ERR! gyp ERR! node -v v20.9.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/mfalce/.npm/_logs/2023-11-17T09_08_59_678Z-debug-0.log
Time: 0h:00m:04s
ice3 commented 1 year ago

I tried, in an docker (FROM node:21-bookworm), it worked as expected.

The problem only manifest on macos from what I see.

bencbartlett commented 9 months ago

I am also running into this issue on MacOS 14.2.1 with M1

webark commented 3 months ago

I'm getting a

# This file contains the result of Yarn building a package (isolated-vm@npm:4.7.2)
# Script name: install

prebuild-install warn install No prebuilt binaries found (target=22.5.1 runtime=node arch=arm64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@22.5.1 | darwin | arm64
gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"

gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/mavery/Development/cvent/stt/backstage/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 '/Users/mavery/Development/cvent/stt/backstage/node_modules/isolated-vm/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/mavery/Development/cvent/stt/backstage/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/mavery/Library/Caches/node-gyp/22.5.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/mavery/Library/Caches/node-gyp/22.5.1',
gyp info spawn args '-Dnode_gyp_dir=/Users/mavery/Development/cvent/stt/backstage/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/mavery/Library/Caches/node-gyp/22.5.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/mavery/Development/cvent/stt/backstage/node_modules/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', 10 ]
  CXX(target) Release/obj.target/nortti/src/external_copy/serializer_nortti.o
  CXX(target) Release/obj.target/nortti/src/isolate/allocator_nortti.o
In file included from ../src/external_copy/serializer_nortti.cc:1:
In file included from ../src/external_copy/serializer.h:2:
In file included from ../src/external_copy/external_copy.h:9:
In file included from ../src/isolate/generic/array.h:2:
../src/isolate/generic/error.h:84:65: error: value of type 'Local<Value> (Local<String>, Local<Value>)' is not implicitly convertible to 'v8::Local<v8::Value> (*)(v8::Local<v8::String>)'
using RuntimeGenericError = detail::RuntimeErrorWithConstructor<v8::Exception::Error>;
                                                                ^~~~~~~~~~~~~~~~~~~~

Which seems like it is similar maybe?

webark commented 3 months ago

forcing greater than 5 resolved my issue.