thecodingmachine / nodejs-installer

An installer package that let's you install NodeJS and NPM as a Composer dependency.
107 stars 30 forks source link

Not working on Windows anymore #39

Closed delmicio closed 3 years ago

delmicio commented 3 years ago
        "mouf": {
            "nodejs": {
                "version": "8.10.0",
                "forceLocal": false
            }
        }
npm WARN engine npm@7.0.6: wanted: {"node":">=10"} (current: {"node":"v8.10.0","npm":"1.4.12"})
...
npm ERR! node -v v8.10.0
npm ERR! npm -v 1.4.12
npm ERR! code E405
npm ERR!
npm ERR! not ok code 0

  [Mouf\NodeJsInstaller\NodeJsInstallerException]          
  An error occurred while updating NPM to latest version. 

It seems that when calling the update on npm it tries to update to a version that requires a higer version than the one installed. node version needed: v8.10.0 npm tries to update to 7.0.6 wich requires node >=10

https://github.com/thecodingmachine/nodejs-installer/blob/4ffc71c79e013fbf34fc0a4331d24649343f928f/src/NodeJsInstaller.php#L251

delmicio commented 3 years ago

NPM removed support for versions lower than 10 on this PR https://github.com/npm/cli/commit/8f6b6204f9cdbfc8e2a27a1c3b3f1591ac7e0d60

delmicio commented 3 years ago

You could fix this by checkin fi the node version is <10 then install npm@6.14.8

delmicio commented 3 years ago

I've sen't a PR to fix it https://github.com/thecodingmachine/nodejs-installer/pull/40