The above issue is a Sitecore
bug, creating a new Sitecore
angular app fails with the latest NPM version.
The error occurs when using NPM 7
and above as the peer dependency installation behavior was changed. As a workaround to this, please manually add --legacy-peer-deps
flag when running npm install
.
#Set your JSS
Project Name
$JssAngularProjectName = ‘test-myapp-angular-app’
#And then run the following
cd $JssAngularProjectName
npm install --legacy-peer-deps
node -e "require('./jss-create.js')({name:'$JssAngularProjectName', hostName:'$JssAngularProjectName.dev.local'}, [])"
rm jss-create.js
Or else we can simply downgrade the NPM
version to any 6.x
, and it will work. For me, 6.14.16
worked.