Monday, December 14, 2020

npm install gulp yo @microsoft/generator-sharepoint error

Problem:
Errors when trying to install SharePoint with npm install gulp yo @microsoft/generator-sharepoint.   It errors out like below
npm ERR! code EEXIST
npm ERR! path C:\Users\XX\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
npm ERR! dest C:\Users\XXX\AppData\Roaming\npm\gulp.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\xxxn\AppData\Roaming\npm\node_modules\gulp\xxx\gulp.js' -> 'C:\Users\xxx\AppData\Roaming\npm\gulp.cmd'
npm ERR! File exists: C:\Users\xxx\AppData\Roaming\npm\gulp.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2020-12-14T19_15_00_552Z-debug.log

Cause: There may be a newer version of gulp and npm is not able to replace.  This command works with certain version only.
Resolution: Remove the npm folder and re install.  Everything is good after that.
There must be other way to pin point exactly what is needed but this seems to be quick fix.

No comments:

Post a Comment