Trouble at building env

Hey there I was trying to build the environment for Joplin
But I ran into the following error
I am using

  • macOS Big Sur 11.2.3
  • node v15.2.0
  • npm v7.0.8
    Is there any comment on this issue?
    Thanks in advance :slight_smile:
{20:11}~/code ➭ cd joplin 
{20:11}~/code/joplin:dev ✓ ➭ npm install

> postinstall
> npm run bootstrap --no-ci && npm run build


> bootstrap
> lerna bootstrap --no-ci

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 15 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in '@joplin/tools'
lerna ERR! npm install stderr:
npm ERR! code 1
npm ERR! path /Users/benji/code/joplin/packages/tools/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR! info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-darwin-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.2.0 | darwin | x64
npm ERR! gyp info spawn /usr/bin/python2
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/benji/code/joplin/packages/tools/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/benji/code/joplin/packages/tools/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/benji/code/joplin/packages/tools/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/benji/.node-gyp/15.2.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/benji/.node-gyp/15.2.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/benji/code/joplin/packages/tools/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/benji/.node-gyp/15.2.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/benji/code/joplin/packages/tools/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! Traceback (most recent call last):
npm ERR!   File "/Users/benji/code/joplin/packages/tools/node_modules/sharp/build/./gyp-mac-tool", line 611, in <module>
npm ERR!     sys.exit(main(sys.argv[1:]))
npm ERR!   File "/Users/benji/code/joplin/packages/tools/node_modules/sharp/build/./gyp-mac-tool", line 28, in main
npm ERR!     exit_code = executor.Dispatch(args)
npm ERR!   File "/Users/benji/code/joplin/packages/tools/node_modules/sharp/build/./gyp-mac-tool", line 43, in Dispatch
npm ERR!     return getattr(self, method)(*args[1:])
npm ERR!   File "/Users/benji/code/joplin/packages/tools/node_modules/sharp/build/./gyp-mac-tool", line 246, in ExecFilterLibtool
npm ERR!     if not libtool_re.match(line) and not libtool_re5.match(line):
npm ERR! TypeError: cannot use a string pattern on a bytes-like object
npm ERR! make: *** [Release/nothing.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 (/Users/benji/code/joplin/packages/tools/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:329:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
npm ERR! gyp ERR! System Darwin 20.3.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/benji/code/joplin/packages/tools/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/benji/code/joplin/packages/tools/node_modules/sharp
npm ERR! gyp ERR! node -v v15.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/benji/.npm/_logs/2021-03-12T19_12_55_573Z-debug.log

lerna ERR! npm install exited 1 in '@joplin/tools'
lerna WARN complete Waiting for 4 child processes to exit. CTRL-C to exit immediately.
npm ERR! code 1
npm ERR! path /Users/benji/code/joplin
npm ERR! command failed
npm ERR! command sh -c lerna bootstrap --no-ci

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/benji/.npm/_logs/2021-03-12T19_12_55_746Z-debug.log
npm ERR! code 1
npm ERR! path /Users/benji/code/joplin
npm ERR! command failed
npm ERR! command sh -c npm run bootstrap --no-ci && npm run build

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/benji/.npm/_logs/2021-03-12T19_12_55_791Z-debug.log

Could you try with Node 12?

This might also be useful

Hey Thanks a lot. I end up with using

npm 6.14.1
node v14.16.0
node-gyp v7.1.2(latest)
python 3.7.8(for node-gyp)

Not sure which change of settings contributes to the successful compile :joy: but it worked in the end

I have a question about the idea Paste Special
Is this plugin for all Joplin applications or a specific one?

1 Like

@StinkyBenji Right now plugins are only supported in Desktop and CLI applications.

Ah okk. Thanks.

1 Like