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

MSVCP140 should not be needed #684

Open
artknight opened this issue Jan 14, 2022 · 15 comments
Open

MSVCP140 should not be needed #684

artknight opened this issue Jan 14, 2022 · 15 comments
Labels
enhancement New feature or request low priority

Comments

@artknight
Copy link

artknight commented Jan 14, 2022

Hi,
I am getting this error Error: This version of µWS is not compatible with your Node.js build: after upgrading to 20.6.0.

I am running node v14.17.0

What is the new node version requirement?

@e3dio
Copy link
Contributor

e3dio commented Jan 14, 2022

Node 14 to 17

@artknight
Copy link
Author

Node 14 to 17

So, node 14.17.0 should have worked then? Why didn't it?

@e3dio
Copy link
Contributor

e3dio commented Jan 14, 2022

You can check each variable in this line https://github.com/uNetworking/uWebSockets.js/blob/binaries/uws.js#L20 process.platform process.arch process.versions.modules for your Node process, and make sure the matching binary is here https://github.com/uNetworking/uWebSockets.js/tree/binaries

@artknight
Copy link
Author

artknight commented Jan 14, 2022

@e3dio here is the system dump

process {
  version: 'v16.13.2',
  versions: {
    node: '16.13.2',
    v8: '9.4.146.24-node.14',
    uv: '1.42.0',
    zlib: '1.2.11',
    brotli: '1.0.9',
    ares: '1.18.1',
    modules: '93',
    nghttp2: '1.45.1',
    napi: '8',
    llhttp: '6.0.4',
    openssl: '1.1.1l+quic',
    cldr: '39.0',
    icu: '69.1',
    tz: '2021a',
    unicode: '13.0',
    ngtcp2: '0.1.0-DEV',
    nghttp3: '0.1.0-DEV'
  },
  arch: 'x64',
  platform: 'win32',
  release: {
    name: 'node',
    lts: 'Gallium',
    sourceUrl: 'https://nodejs.org/download/release/v16.13.2/node-v16.13.2.tar.gz',
    headersUrl: 'https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz',
    libUrl: 'https://nodejs.org/download/release/v16.13.2/win-x64/node.lib'
  },

this file ./uws_win32_x64_93.node definitely exists, just checked

@e3dio
Copy link
Contributor

e3dio commented Jan 14, 2022

I am running node v14.17.0

That says Node 16, you said Node 14. You should also confirm what version uWS.js you are running, check the node_modules/uWebSockets.js/package.json file and see what version it says

@artknight
Copy link
Author

I am running node v14.17.0

That says Node 16, you said Node 14. You should also confirm what version uWS.js you are running, check the node_modules/uWebSockets.js/package.json file and see what version it says

yes, i upgraded after you mentioned that its between 14-17

@artknight
Copy link
Author

{
  "name": "uWebSockets.js",
  "version": "20.6.0",
  "main": "uws.js",
  "types": "./index.d.ts"
}

@e3dio
Copy link
Contributor

e3dio commented Jan 14, 2022

So it should be working for you, I can confirm Node 17 is working for the same system as yours, I don't have Node 16 set up to check

@artknight
Copy link
Author

ok lemme upgrade to 17

@artknight
Copy link
Author

artknight commented Jan 14, 2022

@e3dio yeah that did not fix it.. Here is the actual error

D:\web\ws.cogency.io\node_modules\uWebSockets.js\uws.js:22
                throw new Error('This version of µWS is not compatible with your Node.js build:\n\n' + e.toString());
                ^

Error: This version of µWS is not compatible with your Node.js build:

Error: The specified module could not be found.
\\?\D:\web\example.com\node_modules\uWebSockets.js\uws_win32_x64_102.node
    at D:\web\example.com\node_modules\uWebSockets.js\uws.js:22:9
    at Object.<anonymous> (D:\web\example.com\node_modules\uWebSockets.js\uws.js:24:3)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\web\example.com\app.js:2:13)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)

Node.js v17.3.1

looks like the uws_win32_x64_102.node is not being found.. however it is there!

Also, not sure if this matters, I had v19.3.0 running successfully before the upgrade

@e3dio
Copy link
Contributor

e3dio commented Jan 14, 2022

I see some things for Windows error "The specified module could not be found" for it not finding a DLL that it assumes to be there https://stackoverflow.com/questions/13471457/finding-dll-for-the-specified-module-could-not-be-found You could run Process Monitor and check for the error as described in link

@e3dio
Copy link
Contributor

e3dio commented Jan 14, 2022

console.log(process.pid)
setTimeout(()=>require('uWebSockets.js'),15000)

Run that code, in Process Monitor add filter on that Process ID and start capturing events, then the module will try to load and look for error towards the end

@artknight
Copy link
Author

@e3dio Ok, I got it resolved! Here is what I did

  1. To check for missing dependencies, I downloaded the dependecy checker https://github.com/lucasg/Dependencies

  2. Once downloaded, I ran it on the uws_win32_x64_102.node module to determine if any dependencies were missing.

Indeed, three files needed to be downloaded

MSVCP140.dll
VCRUNTIME140.dll
VCRUNTIME140_1.dll
  1. The files are a part of the Visual Studio runtime env, so it really depends on how the node modules were compiled. In this case just downloading the packages was sufficient

https://aka.ms/vs/17/release/vc_redist.x86.exe
https://aka.ms/vs/17/release/vc_redist.x64.exe

After installing and rebooting the server, the dependencies were found and I was able to run the WS server!

... just in case this helps someone =)

@e3dio
Copy link
Contributor

e3dio commented Jan 14, 2022

I was going to say, looks like those 3 DLL were required

@ghost ghost reopened this Jan 14, 2022
@ghost ghost changed the title what is the node requirement for 20.6.0? MSVCP140 sounds not be needed Jan 14, 2022
@ghost ghost changed the title MSVCP140 sounds not be needed MSVCP140 should not be needed Jan 14, 2022
@ghost ghost added enhancement New feature or request low priority labels Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

2 participants