Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having issues installing on a Macbook Air M1 #62

Open
wei3erHase opened this issue Oct 25, 2021 · 16 comments
Open

Having issues installing on a Macbook Air M1 #62

wei3erHase opened this issue Oct 25, 2021 · 16 comments

Comments

@wei3erHase
Copy link

Receiving the following error:

npm ERR! code 1
npm ERR! path /Users/----------/node_modules/zeromq
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! ACTION binding_gyp_libzmq_target_build_libzmq libzmq/lib
npm ERR! Downloading libzmq source...
npm ERR! Building libzmq...
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] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Users/----------/.pyenv/versions/3.9.6/bin/python3"
npm ERR! gyp info spawn /Users/----------/.pyenv/versions/3.9.6/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/homebrew/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/----------/node_modules/zeromq/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/----------/Library/Caches/node-gyp/17.0.1/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/----------/Library/Caches/node-gyp/17.0.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/----------/Library/Caches/node-gyp/17.0.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/----------/node_modules/zeromq',
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' ]
npm ERR! /Users/----------/node_modules/zeromq/build/Release/../../script/build.sh: line 60: cmake: command not found
npm ERR! make: *** [libzmq/lib] Error 127
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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/17.0.1/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/----------/node_modules/zeromq
npm ERR! gyp ERR! node -v v17.0.1
npm ERR! gyp ERR! node-gyp -v v8.2.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/----------/.npm/_logs/2021-10-25T23_23_23_400Z-debug.log

{\__/}
( • . •)
/ > . < \

@juaquins
Copy link

Had the same issue, it looks like cmake isn't installed:
brew install cmake

@wei3erHase
Copy link
Author

@juaquins
ser, you just unleashed a very powerful tool
{\__/}
( • . •)
/ > 🏆

@RyanGuild
Copy link

Had the same issue, it looks like cmake isn't installed: brew install cmake

This guy, my hero ^^

@tg44
Copy link

tg44 commented Jan 13, 2023

Also brew install libsodium.

@vanjaoljaca
Copy link

brew install pkg-config libsodium cmake zeromq got me through yarn install, but now I'm getting a runtime error:

[I 00:10:50.338 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
dyld[50614]: missing symbol called

Is tslab expected to work on m1?

@tg44
Copy link

tg44 commented Feb 13, 2023

I don't know, I let it go at some point and started prototyping in a single ts file with ts-node...

@wei3erHase
Copy link
Author

i can verify it works, but i couldn't replicate it if i had to reinstall, i believe brew install cmake and then run tslab install and follow the readme should do the work, is very experimental imo, VSCode works better than Jupyter Lab (but also needs tslab interpreter)

@aecorredor
Copy link

We have a docker image that has tslab installed (based off of the one from deepnote) and it works everywhere except on a couple of M1 laptops we have. Does anybody know why it wouldn't work even if it's running on a container? The kernels are even listed on jupyter lab, but when choosing TS/JS it just hangs when connecting to the kernel and ends up saying unknown kernel.

@wei3erHase
Copy link
Author

Have u tried the above instructions? For me no need to do a docker container, actually even vs code jupyter environment loads it.

@dbuezas
Copy link

dbuezas commented Aug 24, 2023

Weirdly enough, npm -g doesn't work for me (after all the brew install commands from above) but pnpm does

@wei3erHase
Copy link
Author

hmmm is very unstable tech, weirdly enough is one of those things that work, until they don't and they start to work again with no explanation at all.
should this tech have more development and support and could be a very powerful toolset.
i recommend also using VSCode notebook support, but the TS features are very limited there.

@astears
Copy link

astears commented Sep 9, 2023

brew install pkg-config libsodium cmake zeromq got me through yarn install, but now I'm getting a runtime error:

[I 00:10:50.338 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
dyld[50614]: missing symbol called

Is tslab expected to work on m1?

Were you ever able to solve this runtime issue? I am experiencing it now.

@wei3erHase
Copy link
Author

Hmmm doesn't ring a bell for me, sorry pal.

@douglas-linder-hireup
Copy link

douglas-linder-hireup commented Sep 14, 2023

Were you ever able to solve this runtime issue? I am experiencing it now.

@astears Almost certainly you are building it for x86 instead of arm.

You can test this by simply running:

node
...
require('zeromq')

If you get the error, you've built it for the wrong architecture.

When you watch the build you will see something like this:

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64 <---- Correct

If you use an incorrect arch command, or an ancient version of node, you will see:

> [email protected] install /Users/douglas.linder/dev/work-snippets/notebooks/tools/zeromq.js
> (shx test -f ./script/build.js || run-s build.js) && cross-env npm_config_build_from_source=true node-gyp-build

No native build was found for platform=darwin arch=x64 runtime=node abi=83 uv=1 libc=glibc node=14.16.1 
^^^^^ <----- using x64 architecture because node 14 is so old. 

Don't do that.

If you're installing sodium with brew, you're installed the arm version; you can't do a x86_64 build with an arm dependency; that's why this error occurs.

At any rate, if you still can't fix it, the problem has nothing to do with tslab; see this thread in the zeromq repo; it's an upstream issue.

If you can't get zeromq working, tslab won't ever work.

...

The most common reason this happens is using node 14 or something older.

If you're not already, try node 18.

If that doesn't help, it's because of the issues in zeromq. :/

(The second, imo, reason people struggle to get tslab working is because they failed to install it globally; you cannot run the tslab kernel if it is not globally installed, because the kernel execution:

tools % jupyter kernelspec list
Available kernels:
  python3    /opt/homebrew/Caskroom/miniconda/base/envs/notebooks/share/jupyter/kernels/python3
  jslab      ~/Library/Jupyter/kernels/jslab
  tslab      ~/Library/Jupyter/kernels/tslab

tools % cat ~/Library/Jupyter/kernels/tslab/kernel.json
{"argv": ["tslab", "kernel", "--config-path", "{connection_file}"], "display_name": "TypeScript", "language": "typescript"}%

^ Executes the global tslab executable when it starts.

If you install tslab locally you have to patch this kernel path to the local node_modules /.bin folder.)

@zthxxx
Copy link

zthxxx commented Oct 26, 2023

same issue with Mac M2

Update: install cmake is work for me.

@dbuezas
Copy link

dbuezas commented Oct 26, 2023

Were you ever able to solve this runtime issue? I am experiencing it now.

I'm using it in an m1. Installing it with npn didn't work, but pnpm did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants