npm ERR! Unexpected token '.'
> nvm use 16.18.0
> npm install yarn -g
npm ERR! Unexpected token '.'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\flemieux\AppData\Local\npm-cache\_logs\2022-10-28T16_39_54_977Z-debug-0.log
Solution
Use the latest working Node version with nvm 1.1.7
> nvm install 16.13.2
> nvm use 16.13.2
Now using node v16.13.2 (64-bit)
> npm install yarn -g
added 1 package in 3s
Why ?
You are probably using nvm 1.1.7. This is because of a limitation in nvm fixed in the newest version. But the newest nvm release also has an unresolved issue where elevated privileges are not working. So pick your poison: either go with an older nvm and older nodejs; or newer nvm and newer nodejs but broken elevated privileges prompt.
Recent Comments