Unknown profile version

What's the output of node-gyp --version ?

node-gyp not found
interesting.

@laurent I will have to try those commands a little later on, I'm not at the computer at the moment. will update once I have tried

I found this issue where the error message is the same yours: [ERROR] TypeError: cannot use a string pattern on a bytes-like object ยท Issue #2121 ยท nodejs/node-gyp ยท GitHub
And there the root cause was 2 different node-gyp versions installed.

So according to stacktrace above,

npm ERR! gyp info using node-gyp@3.8.0

(presumably) indicating that I have version 3.8.0 installed.

As mentioned, node-gyp --version turns no result, and there is also no output to which node-gyp.

I now run npm i -g node-gyp, and have version 7.1.2 on my system, and run npm i -g joplin@latest again.

However, I get the same result. I half expected this, since there is mention of a node-gyp version 3.8.0 above (to be sure, I am using node 14.5.0, which is the same version listed above). Therefore, I am fairly certain that in some way, shape or form, there is an mismatch of node-gyp versions on my system, I just don't know how to locate one of them...

Any idea how I can go about finding this binary?

Well, it seems that basically, my node installation was a mess. I had installed node with Homebrew, but was also using nvm. I had obviously failed to realize that when using nvm, no other version of node needs to be installed.

I ran brew uninstall node, and removed nvm, leaving me with a single installation of node (LTS found here Download | Node.js)

I also removed all global node_modules that I could find, and started from scratch with ~/.npm-global directory. Then I ran npm i -g joplin@latest again, and this time get a different error, though still related to the Sharp module:

/Users/kyle/.npm-global/lib/node_modules/joplin/node_modules/sharp/lib/constructor.js:34
  throw new Error(error);
  ^

Error:
Something went wrong installing the "sharp" module

dlopen(/Users/kyle/.npm-global/lib/node_modules/joplin/node_modules/sharp/build/Release/sharp.node, 1): Library not loaded: /usr/local/opt/imagemagick/lib/libMagickCore-7.Q16HDRI.7.dylib
  Referenced from: /usr/local/opt/vips/lib/libvips-cpp.42.dylib
  Reason: image not found

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

    at Object.<anonymous> (/Users/kyle/.npm-global/lib/node_modules/joplin/node_modules/sharp/lib/constructor.js:34:9)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/kyle/.npm-global/lib/node_modules/joplin/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

I am not sure what to attempt at this point, since I do not have a good understanding of the problem. Npm gives a suggestion above, which is to remove the sharp module (presumably in the Joplin project?). Yet this seems like an odd measure to me, and is presumably a red herring.

For the record I'm getting the exact same error as you. My global installation works but then when I try to run 'joplin' in zsh I get this log:

/Users/jkrl/.nvm/versions/node/v14.0.0/lib/node_modules/joplin/node_modules/sharp/lib/constructor.js:34
  throw new Error(error);
  ^

Error: 
Something went wrong installing the "sharp" module

dlopen(/Users/jkrl/.nvm/versions/node/v14.0.0/lib/node_modules/joplin/node_modules/sharp/build/Release/sharp.node, 1): Library not loaded: /usr/local/opt/vips/lib/libvips-cpp.42.dylib
  Referenced from: /Users/jkrl/.nvm/versions/node/v14.0.0/lib/node_modules/joplin/node_modules/sharp/build/Release/sharp.node
  Reason: image not found

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

    at Object.<anonymous> (/Users/jkrl/.nvm/versions/node/v14.0.0/lib/node_modules/joplin/node_modules/sharp/lib/constructor.js:34:9)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/jkrl/.nvm/versions/node/v14.0.0/lib/node_modules/joplin/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)

I don't think it has anything to do with the node installation because I've used nvm from the start and never from the /usr directory. It was working fine for me with the Homebrew installation up until recently but it looks like they've changed it so that brew install joplin installs as a cask now and not the CLI version.

As far as solutions I have nothing to offer except solidarity, haha. I wonder if there's an actual upstream issue with sharp? I really have no idea but it sucks because I'd love to get on the app. Thanks for posting your issue!

Perhaps it would be worth reporting this on the Sharp repo in case they know a fix?

@Tycholiz Sharp Module Installation Error: Library not loaded: @rpath/libvips-cpp.42.dylib ยท Issue #2029 ยท lovell/sharp ยท GitHub
Figured it out! Pretty obscure issue but it looks like sharp uses a library called libvips for image processing. Sharp provides a version but you can also install one with brew, (which I apparently did at some point, though I have no idea why). If your brew and Sharp provided versions are mismatched you will get the error. All I did was run brew uninstall libvips, then reinstall Joplin with npm i joplin -g and I was rolling. Hope that works!

3 Likes

Glad to hear it worked for you!

I ran through your instructions, but unfortunately was not able to reach the same happy resolution :frowning:

I have put this on the backburner for the time being, and have just been relying on manually backing up from UI (which I'd like to replace properly soon).

Thanks for reporting back!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.