'Error while compiling css and js files using gulp

I am getting the below mentioned error and I am not able to figure out how to handle it. Versions of gulp, node and npm are mentioned below. I don't know if it is node's version mismatch with that of gulp or something else but so far any help would be much appreciated.

gulp -v
CLI Version: 2.3.0
Local Version: 3.9.1

node -v
v6.10.3

npm -v
3.10.10

ERROR

C:\xampp\htdocs\ecommerce\node_modules\engine.io\build\server.js:173

    async handshake(transportName, req, closeConnection) {
          ^^^^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\xampp\htdocs\ecommerce\node_modules\engine.io\build\engine.io.js:5:18)


Solution 1:[1]

Support for async functions was added in Node 7.6.0.

You are using Node 6.10.3.

You need to upgrade.

The oldest version of Node which is still supported (although only for a matter of weeks!) is version 12.

Upgrade to at least version 16.14.2 (the current long term support release).

Solution 2:[2]

install version 8.11.1 and run :

npm install
npm install gulp bower --global
            
npm install node-sass@latest
npm uninstall laravel-elixir
npm uninstall session
npm install --save laravel-elixir
npm install --save session
gulp

after that it will work

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Quentin
Solution 2 NeverSleeps