Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Migrations fail on Windows + Node 13.x #44

Closed
toubsen opened this issue Nov 5, 2019 · 1 comment
Closed

Migrations fail on Windows + Node 13.x #44

toubsen opened this issue Nov 5, 2019 · 1 comment

Comments

@toubsen
Copy link
Contributor

toubsen commented Nov 5, 2019

Running subzero-migrations add on Windows 10 and nodejs 13.0 fails with an error. The source is the node module "sleep" which has not been updated / recompiled for nodejs 13.x.

Error output:

C:\dev\foo>subzero-migrations add
internal/modules/cjs/loader.js:1041
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '\\?\C:\Users\bar\AppData\Roaming\npm\node_modules\subzero-cli\node_modules\sleep\build\Release\node_sleep.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 79. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
�[90m    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1041:18)�[39m
�[90m    at Module.load (internal/modules/cjs/loader.js:822:32)�[39m
�[90m    at Function.Module._load (internal/modules/cjs/loader.js:730:14)�[39m
�[90m    at Module.require (internal/modules/cjs/loader.js:864:19)�[39m
�[90m    at require (internal/modules/cjs/helpers.js:74:18)�[39m
    at Object.<anonymous> (C:\Users\bar\AppData\Roaming\npm\node_modules\�[4msubzero-cli�[24m\node_modules\�[4msleep�[24m\index.js:1:13)
�[90m    at Module._compile (internal/modules/cjs/loader.js:971:30)�[39m
�[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)�[39m
�[90m    at Module.load (internal/modules/cjs/loader.js:822:32)�[39m
�[90m    at Function.Module._load (internal/modules/cjs/loader.js:730:14)�[39m

Versions:

C:\>node --version
v13.0.1
C:\>npm --version
6.12.0
@ruslantalpa
Copy link
Member

this is probably because you already had subzero-cli installed then you upgraded your node version (probably using nvm) and the already installed global modules remained as is (see this if you used nvm https://github.com/nvm-sh/nvm#migrating-global-packages-while-installing)

or maybe you installed subzero-cli from source and used "link" and then upgraded node.

I am in a complicated setup (windows and WSL at the same time) so I also had some issues (reproduced your bug), what I suggest is this:

npm r -g subzero-cli
npm I -g -f subzero-cli

-f stands for force download of packages even if local cache is available

I was able to successfully run "migrations" in node 13 (on linux/wsl)

(please reopen if does not work)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants