於Windows 7 執行 新版Node.js的方法


之前發現Node.js不再支援 Win7,所以後來一直沒辦法在舊系統執行新版的node,後來找到這篇,原來有這折衷辦法:

https://stackoverflow.com/questions/62212754/latest-nodejs-compatible-with-windows-7

The workaround Method (for versions mentioned above)

The v12.x branch seems to continue supporting Win7 (tested 2021 with Node v12.22.7).

But I needed 14.x version-branch and ended solving problem;
I just installed Node 14.15.0, like:

  • Go to Node-downloads
  • Download the Windows Binary (.zip) (either 32/64 bit)
  • Extract it in the directory where your node is installed and say yes to replace all files (remember that the zip comes with npm, which is in node_modules/npm directory; I didn't copy from the zip because I already updated npm before replacing the files)
  • Create an Environment variable called: NODE_SKIP_PLATFORM_CHECK and set it to 1
  • Ready to use Node in Windows 7 for now.

簡單說,就是下載zip檔,解開後覆蓋舊版Node.js檔案,於cmd下先建立環境名稱:
SET NODE_SKIP_PLATFORM_CHECK=1
之後就可以強迫執行node,但是不保證都能執行順利

留言