Home > Software engineering >  Unexpected token '.' when trying to run 'npm install'
Unexpected token '.' when trying to run 'npm install'

Time:02-03

I am trying to install the angular cli with 'npm install -g @angular/cli' and I am met with the following error:

npm ERR! Unexpected token '.'
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\<user>\AppData\Local\npm-cache\_logs\2022-02-02T15_25_07_320Z-debug-0.log

Version of npm: 8.3.1 Version of node: v17.4.0

Any help would be greatly appreciated! Thank you :)

CodePudding user response:

This is a reported issue for npm version 8.3.1.

Your best bet is to skip this version (Either use 8.3.2 or 8.4), use an earlier version (8.3.0) or use another node version (< 17).

CodePudding user response:

You may try removing the package-lock.json by rm package-lock.json. then try again.

  •  Tags:  
  • Related