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

Sharp build with wrong NODE_MODULE_VERSION when deploying using meteor-up #1374

Closed
Neijin opened this issue Sep 10, 2018 · 6 comments
Closed
Labels

Comments

@Neijin
Copy link

Neijin commented Sep 10, 2018

Hi guys ! First of all, thank you for this package and for all your work in the issues section, it has been a great help.

Context

I'm trying to deploy my meteor project on production using [zodern/meteor-up].(https://github.com/zodern/meteor-up).

Dev :
Windows 10 (x64)
meteor 1.7.0.5
meteor-up 1.4.5
node v8.11.4 (only one version installed)

Prod :
Docker instance (abernix/meteord:node-8.11.2-base image) running on Debian 9
node v8.11.2

Build

During build sharp is not detecting any global installation of libvips and get the pre-compiled binaries from the github repo.

> sharp@0.20.8 install /built_app/programs/server/npm/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.6.1/libvips-8.6.1-linux-x64.tar.gz

Error

Everything looks successfull until meteor starts. Then this error occurs:

/built_app/programs/server/node_modules/fibers/future.js:280
                                                throw(ex);
                                                ^

Error: The module '/built_app/programs/server/npm/node_modules/sharp/build/Release/sharp.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 46. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:681:18)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/built_app/programs/server/npm/node_modules/sharp/lib/constructor.js:10:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/built_app/programs/server/npm/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (module.js:652:30)

I tried a lot a different approaches during these past two days without success.
Do you guys have any ideas ?

@Neijin Neijin changed the title Sharp built with wrong NODE_MODULE_VERSION when deploying using meteor-up Sharp build with wrong NODE_MODULE_VERSION when deploying using meteor-up Sep 10, 2018
@lovell
Copy link
Owner

lovell commented Sep 11, 2018

Hello, the ...was compiled against a different Node.js version using NODE_MODULE_VERSION 46 error means that Node 4 was used at npm install time so there must be a previous, conflicting version of Node. https://nodejs.org/en/download/releases/

@Neijin
Copy link
Author

Neijin commented Sep 12, 2018

I understand that. But since Node 4 is not installed both in Dev & Prod as indicated, do you think it can come from any of the sharp dependencies ?

I checked for any forgotten installation of Node 4 pretty much anywhere I could think of (there is a great reminder by the way on how to completely remove node.js from Windows). The only Node version installed on my dev environment is the 8.11.4.

I also removed the node-modules/sharp/vendor folder before pushing to production.

@Neijin
Copy link
Author

Neijin commented Sep 12, 2018

I got it working by pushing from a MacOSX dev environment. Sharp is then compiled with the right NODE_VERSION on the production server. I'm clueless on how to resolve this issue on Windows and why there is a difference.

@lovell If that's ok, I'd like to keep this issue open just in case something new comes up ? Thank you for your reponse.

@lovell
Copy link
Owner

lovell commented Sep 12, 2018

What is the output when npm install --verbose sharp is run on the Windows machine?

@lovell
Copy link
Owner

lovell commented Oct 1, 2018

Feel free to re-open with more information if this problem remains.

@lovell lovell closed this as completed Oct 1, 2018
@ahkong0429
Copy link

npm info it worked if it ends with ok
npm verb cli [ '/www/server/nvm/versions/node/v8.7.0/bin/node',
npm verb cli   '/www/server/nvm/versions/node/v8.7.0/bin/npm',
npm verb cli   'install',
npm verb cli   '--verbose',
npm verb cli   'sharp' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 0cd7a01f3f50ab19
npm http fetch GET 304 https://registry.npmjs.org/sharp 59ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/bindings 21ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/npmlog 40ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar 40ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/prebuild-install 42ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fs-copy-file-sync 45ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color 46ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-get 46ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/detect-libc 62ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/file-uri-to-path 13ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-string 16ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-convert 70ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-name 26ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-swizzle 57ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/is-arrayish 31ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/are-we-there-yet 19ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/console-control-strings 18ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/set-blocking 19ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/gauge 21ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/delegates 15ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/aproba 49ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/has-unicode 50ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/string-width 51ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/signal-exit 51ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/strip-ansi 53ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/wide-align 55ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/is-fullwidth-code-point 14ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/code-point-at 14ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/number-is-nan 12ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ansi-regex 15ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/expand-template 22ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/node-abi 24ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/napi-build-utils 27ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minimist 29ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/noop-logger 38ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-fs 29ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/rc 39ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/pump 42ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/which-pm-runs 20ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/github-from-package 87ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/os-homedir 108ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/end-of-stream 19ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/deep-extend 24ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ini 25ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/strip-json-comments 24ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/decompress-response 13ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-concat 15ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mimic-response 12ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/chownr 17ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-stream 19ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/to-buffer 15ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fs-constants 16ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/bl 59ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/buffer-alloc 126ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/buffer-alloc-unsafe 34ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/buffer-fill 38ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/yallist 22ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minizlib 23ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minipass 27ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fs-minipass 29ms (from cache)
npm verb correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /root/.npm/_locks/staging-c231eaedd410085d.lock for /www/wwwroot/default/express-ffmpeg/node_modules/.staging
npm info lifecycle [email protected]~preuninstall: [email protected]
npm info lifecycle [email protected]~uninstall: [email protected]
npm verb unbuild rmStuff [email protected] from /www/wwwroot/default/express-ffmpeg/node_modules
npm info lifecycle [email protected]~postuninstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm info lifecycle [email protected]~install: [email protected]

> [email protected] install /www/wwwroot/default/express-ffmpeg/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /root/.npm/_libvips/libvips-8.7.4-linux-x64.tar.gz
prebuild-install info begin Prebuild-install version 5.2.5
prebuild-install info looking for cached prebuild @ /root/.npm/_prebuilds/5b92c3-sharp-v0.22.0-node-v57-linux-x64.tar.gz
prebuild-install info found cached prebuild 
prebuild-install info unpacking @ /root/.npm/_prebuilds/5b92c3-sharp-v0.22.0-node-v57-linux-x64.tar.gz
prebuild-install info unpack resolved to /www/wwwroot/default/express-ffmpeg/node_modules/sharp/build/Release/sharp.node
prebuild-install info unpack required /www/wwwroot/default/express-ffmpeg/node_modules/sharp/build/Release/sharp.node successfully
prebuild-install info install Successfully installed prebuilt binary!
npm verb lifecycle [email protected]~install: unsafe-perm in lifecycle false
npm verb lifecycle [email protected]~install: PATH: /www/server/nvm/versions/node/v8.7.0/lib/node_modules/npm/bin/node-gyp-bin:/www/wwwroot/default/express-ffmpeg/node_modules/sharp/node_modules/.bin:/www/wwwroot/default/express-ffmpeg/node_modules/.bin:/www/server/nvm/versions/node/v8.7.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
npm verb lifecycle [email protected]~install: CWD: /www/wwwroot/default/express-ffmpeg/node_modules/sharp
npm info lifecycle [email protected]~postinstall: [email protected]
npm verb unlock done using /root/.npm/_locks/staging-c231eaedd410085d.lock for /www/wwwroot/default/express-ffmpeg/node_modules/.staging
npm verb saving [ { name: 'sharp', spec: '^0.22.0', save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm verb shrinkwrap skipping write for package-lock.json because there were no changes.
npm info lifecycle undefined~postshrinkwrap: undefined

Repository owner locked and limited conversation to collaborators Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants