ZepKit: `zos init zepkit` failes (scrypt compiled against a different Node.js version)

Hello,

I am not able to run zos init zepkit on my machine. I followed all the instructions I have found.

The error is as follows:

$ zos init zepkit
internal/modules/cjs/loader.js:718
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '\\?\C:\Users\...\AppData\Roaming\npm\node_modules\zos\node_modules\scrypt\build\Release\scrypt.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 59. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\...\AppData\Roaming\npm\node_modules\zos\node_modules\scrypt\index.js:3:20)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

any suggestions how to solve that?

1 Like

Hello! Thanks for using the forum!

Think you can try npm install? What node version (node --version) are you using?

Thanks!

1 Like

I don’t think that solves my problem:

~/git/kryptokrauts/smart-contracts (master)
$ cd ethereum/zepkit/

~/git/kryptokrauts/smart-contracts/ethereum/zepkit (master)
$ npm install
audited 110673 packages in 4.538s
found 0 vulnerabilities


~/git/kryptokrauts/smart-contracts/ethereum/zepkit (master)
$ zos init zepkit
internal/modules/cjs/loader.js:718
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '\\?\C:\Users\...\AppData\Roaming\npm\node_modules\zos\node_modules\scrypt\build\Release\scrypt.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 59. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\...\AppData\Roaming\npm\node_modules\zos\node_modules\scrypt\index.js:3:20)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

 ~/git/kryptokrauts/smart-contracts/ethereum/zepkit (master)
$ node -v
v10.15.0

Hello @marc0olo, can you try npm install -g zos please? It appears your global zOS is having the issue.

as far is I know I already did that because I saw that.

any other suggestions?

Hey @marc0olo have you tried running npm rebuild as the error message suggests?

I am quite sure I did all suggested steps. But when I find time I will try again just to be sure.

As Ivan suggested, it seems like you have installed zos globally with an older version of node, and now that you have a new one it’s causing this conflict. I’d try uninstalling and installing globally again from scratch.

ok thanks @IvanTheGreatDev and @martriay. it was definitely necessary to uninstall and reinstall zos globally :slight_smile: