Can you please paste the command you ran and all the output here? It would be helpful if you can run the command in verbose mode here.
npm install --verbose
Finally solved the issue. The error was because of the old node version. After upgrading node to the latest version everything is working fine.