There is a problem with upgrading npm under Windows. The inital install done as part of the nodejs install using an msi package will create an npmrc file:
C:Program Files
odejs
ode_modules
pm
pmrc
when you update npm using:
npm install -g npm@latest
it will install the new version in:
C:UsersJackAppDataRoaming
pm
assuming that your name is Jack, which is %APPDATA%
pm.
The new install does not include an npmrc file and without it the global root directory will be based on where node was run from, hence it is C:Program Files
odejs
ode_modules
You can check this by running:
npm root -g
This will not work as npm does not have permission to write into the "Program Files"
directory. You need to copy the npmrc file from the original install into the new install. By default the file only has the line below:
prefix=${APPDATA}
pm
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…