joplin icon indicating copy to clipboard operation
joplin copied to clipboard

Terminal app installation issue on Mac (M1 Pro)

Open andypiper opened this issue 2 years ago • 2 comments

Environment

Joplin version: latest version of joplin terminal from npm Platform: macOS OS specifics: macOS 12.1, M1 Pro ARM64, homebrew Python and node/npm

Steps to reproduce

  1. Attempt to install Joplin CLI using npm install joplin (also with -g)

Describe what you expected to happen

Joplin to be installed and usable from the CLI.

Logfile

CLI Output:

npm install joplin
npm WARN deprecated @types/[email protected]: This is a stub types definition. nanoid provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated @braintree/[email protected]: Potential XSS vulnerability patched in v6.0.0.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Version no longer supported. Upgrade to @latest
npm WARN deprecated [email protected]: Version no longer supported. Upgrade to @latest
npm ERR! code 1
npm ERR! path /Users/andypiper/node_modules/joplin/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-darwin-arm64v8.tar.br
npm ERR! ERR! sharp Prebuilt libvips 8.10.0 binaries are not yet available for darwin-arm64v8
npm ERR! info sharp Attempting to build from source via node-gyp but this may fail due to the above error
npm ERR! info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
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.13 found at "/opt/homebrew/opt/[email protected]/bin/python3.9"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/andypiper/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/andypiper/node_modules/joplin/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/andypiper/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/andypiper/Library/Caches/node-gyp/18.4.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/andypiper/Library/Caches/node-gyp/18.4.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/andypiper/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/andypiper/Library/Caches/node-gyp/18.4.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/andypiper/node_modules/joplin/node_modules/sharp',
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! warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! ../src/common.cc:24:10: fatal error: 'vips/vips8' file not found
npm ERR! #include <vips/vips8>
npm ERR!          ^~~~~~~~~~~~
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/sharp/src/common.o] 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 (/Users/andypiper/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:537:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.5.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/18.4.0/bin/node" "/Users/andypiper/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/andypiper/node_modules/joplin/node_modules/sharp
npm ERR! gyp ERR! node -v v18.4.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/andypiper/.npm/_logs/2022-07-04T19_13_36_658Z-debug-0.log

2022-07-04T19_13_36_658Z-debug-0.log

Notes

I successfully ran npm install sharp without error. It looks like this is trying to install a backlevel version of libvips (8.10) for which there is no ARM64 build so it then tries to compile one. Later versions of libvips are available in binary builds for ARM64.

andypiper avatar Jul 04 '22 19:07 andypiper

I was able to avoid this error by installing libvips with brew:

brew install vips

But I'm guessing you're saying that joplin's dependencies should be updated so this brew install isn't needed, which is a fair point.

benallan avatar Jul 23 '22 13:07 benallan

Ah, thanks for this tip - I’ll give it a try.

andypiper avatar Jul 24 '22 00:07 andypiper

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

github-actions[bot] avatar Aug 23 '22 16:08 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Aug 30 '22 16:08 github-actions[bot]

FWIW, brew install joplin-cli is now working fine on Ventura (although it pulls in a Monterey-labelled package`

andypiper avatar Oct 29 '22 13:10 andypiper

Possibly related to https://discourse.joplinapp.org/t/unable-to-install-npm-package/36962