1

While setting up my first headless Sitecore 10.2 angular app, I was getting errors like unable to resolve dependency tree

Sitecore version 10.2
NPM version 8.6.0
Node 17.8.0 

Command that is failing: jss create test-myapp-angular-app angular

Sitecore jss version: Sitecore Headless Services Server XP 19.0.0 rev. 00508.zip

0

1 Answer 1

1

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.

  • Node-16.14.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.