4

I try to deploy the project which is developed in nodejs version v6.x and edgejs version v0.11 into production environment node version v.8.x.. Getting error seems "The edge module has not been pre-compiled for node.js version v8.9.3".

I googled they recommended to downgrade the node js version, but i can't bcz other projects which is already running in server is dependent node v8.x.

I have updated the edgejs to ^7.10.1. but not working.

enter image description here

Aaron Chen
  • 9,835
  • 1
  • 16
  • 28
Arun A
  • 155
  • 5
  • 13

2 Answers2

3

Hopefully the error description is clear. So here what I did when I got this error :

  • Go to https://github.com/tjanczuk/edge
  • Download the repository and extract it
  • Open a terminal and go to the tools folder
  • run build.bat release 8.9.3
  • copy the generated files in the edge npm folder

    %AppData%\npm\node_modules\vs-tac\node_modules\edge\lib\native\win32\x64

    in my case :

    • concrt140.dll
    • msvcp140.dll
    • vccorlib140.dll
    • the 8.9.3 folder
  • edit the %AppData%\npm\node_modules\vs-tac\node_modules\edge\lib\edge.js file

  • Add an entry for your version in the versionMap variable.

     var versionMap = [
    [ /^0\.8\./, '0.8.22' ],
    [ /^0\.10\./, '0.10.0' ],
    [ /^0\.12\./, '0.12.0' ],
    [ /^4\./, '4.1.1' ],
    [ /^5\./, '5.1.0' ],
    [ /^6\./, '6.11.3' ],
    [ /^8\./, '8.9.3' ] ];
    
  • Enjoy !

Djames
  • 462
  • 7
  • 14
  • I get error 'unable to download node' when running build.bat :( – john k Sep 14 '20 at 13:34
  • @johnktejik : You should check if the link where build.bat is trying to download node works. – Djames Jul 13 '21 at 09:48
  • @johnktejik : If it does not work, check if the version you entered is correct. You could refer to the script tools/download.js in the source of the edge project on GitHub to see how it works. And if you still have the problem, you can search/open an issue on their GitHub. – Djames Jul 13 '21 at 09:57
  • @johnktejik the download error is due to the download URL being HTTP and the server is redirecting to HTTPS but the download script does not follow the redirect. To fix it open the file `download.js` in the tools directory and replace ALL http for https. you need to change lines 1, 6, 7 12, 13 21 (change the variables, imports, and the strings with the URLs). This should fix your download problem – Flávio Fonseca Nov 21 '21 at 15:54
  • BTW, there's a PR opened on GitHub since 2020 to fix this issue but has not been merged yet. Looks like the project is abandoned.... – Flávio Fonseca Nov 21 '21 at 16:00
0

I also faced this issue with node version 18.12.0 and I used edge-js instead of edge. This worked fine for me.

Use this link:https://libraries.io/npm/edge-js

Zen-99
  • 1