How to use specific isolated NodeJS version for an Node APP on Windows with iisnode

  1. download specific version of node.exe from Previous Releases | Node.js (win-x64)
  2. put the node.exe file along with your project root folder or any other folder that you can find
  3. configure the nodeProcessCommandLine in web.config or iisnode.yml
    • web.config
      • <iisnode nodeProcessCommandLine="path\to\node.exe" />
    • iisnode.yml
      • nodeProcessCommandLine: "path\to\node.exe"
  4. create a index.js file to test it
    • var http = require('http');
      http.createServer(function(req,res) {
        res.writeHead(200, {'Content-Type': 'text/html'});
        res.end('Node.js ' + process.version);
      }).listen(process.env.PORT);
创建时间:6/26/2022 2:01:07 AM 修改时间:6/26/2022 2:03:55 AM