npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! Unexpected token '.'
Everything was working well in my machine. but suddenly npm/npx started throwing the above error.
I'm getting the same error for every npm commands.
system config:
OS: Windows 10
Node V : v16.15.1
npm v : 8.11.0
I have tried below solutions so far:
- npm cache clean --force (throwing the same error)
- ran commands with --location=global
- modified npm and npm.cmd file by replacing prefix -g with prefix --location=global