This is probably not a problem with npm. There is likely additional logging output above.
The error shows above message, most probably the Node.js in your machine are lower than 8, kindly check the version by
node -v