Search code examples
compiler-errorsruntime-error

Updated my node version to v17.3.0 and local host is not able to run the application


The console shows the following error:

"Uncaught SyntaxError: expected expression, got '< ' '"

The screen shot of the error is attached below for reference, please. Would be of great help if someone knows the solution to this issue or have faced similar sort of problem with the newest version of node. For error details please click here

To resolve the issue, I've already tried the following:

  1. cleaned the cache files by running the following command:

npm cache clean -f

  1. tried to reinstall node by using the following command:

npm install -g n

If anyone gets the solution, please share with the community.


Solution

  • Well, after some efforts I've been able to resolve the issue by un-installing the latest version of node as its on trial and testing phase right now.

    Ran the following commands and issue got resolved.

    1. remove the pre-installed node.

    sudo apt-get remove nodejs

    1. Installed a stable version of node.

    sudo n 11.14.0

    Remember to uninstall the node_modules folder and run npm install to install the new one. Got my app fixed through these steps.