galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.14k stars 169 forks source link

Urgent: NODE_MODULE_VERSION 48 require NODE_MODULE_VERSION 57 #246

Open isidoreony opened 6 years ago

isidoreony commented 6 years ago

I am getting this error on Nodejs compiled against a different Node.js version using\nNODE_MODULE_VERSION 48. This version of Node.js requires\nNODE_MODULE_VERSION 57. Please try re-compiling or re-installing\nthe module (for instance, using npm rebuild or npm install)

I was able to add node-pre-gyp, did --build-from-source and --update-library. Still no luck. We don't want to roll back node version because other users said this did not fix similar issues. Please help. We really need this library.

chunyenHuang commented 6 years ago

I just clone this repo and compile it without any issue. Can you try again from a clean repo?

node -v # v8.9.4 (57)
git clone https://github.com/galkahana/HummusJS.git
npm i
rm -rf binding
node-pre-gyp install --build-from-source
npm test
# All tests work

# If I switch node version and re-run the test with mismatch node version
nvm use v.6.10.2
node -v # v6.10.2 (48)
npm test
# Error: Module version mismatch. Expected 48, got 57.

# If I build in 6.10.2 and change back to 8.9.4
# NODE_MODULE_VERSION 48. This version of Node.js requires
# NODE_MODULE_VERSION 57. Please try re-compiling or re-installing

You will need to confirm your building and running environments are the same. This should be your case. For example, you use jenkins to build the server and deploy it to the different aws nodejs environment.

isidoreony commented 6 years ago

Hello @chunyenHuang,

Thanks for your response. I installed HummusJS in the production environment as it is the one that is Linux. I was also testing from there. I am happy you made progress with the build. However, I did not have node 8.9.4. Mine was 8.4.0. So, I now installed 8.9.4 but the system is not compiling. I will work with the guideline you provided. I am also seeing my environment is mixing up node versions. I will have to clean this up first.

Please feel free to add any inputs.

Regards.