Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. AWS
  3. Question
AWS

npm command not found when working with jest in LWC

Asked by Dipesh Bhardwaj Jul 21, 2021 1.8K views 1 answer
Share

About this question

I am doing this trailhead module to get started with testing in LWC. The first step is to run below command sfdx force:lightning:lwc:test:setup But when I run this in terminal, I am getting a below error. ERROR running force:lightning:lwc:test:setup: npm command not found. Verify npm is properly installed and try again. I have verified npm is installed in my system, below is the screenshot.

as an alternate I downloaded jest library from git but now not sure how to use this library in my current project so that I can run the next command node node_modules/@salesforce/sfdx-lwc-jest/bin/sfdx-lwc-jest Can someone please suggest this, I have tried the same thing in different machines and all of them are failing with the same error.

Your answer

1 Answer

More AWS discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest AWS Blogs

Guides, tips and career advice on AWS from JanBask experts.