What does 'npm rebuild' do, and when should I use it?

Question

Grade: Education Subject: Support
What does 'npm rebuild' do, and when should I use it?
Asked by:
53 Viewed 53 Answers

Answer (53)

Best Answer
(335)
The `npm rebuild` command rebuilds native modules (those written in C/C++) that might have compilation issues due to changes in your Node.js version or system environment. Use it if you suspect problems with native dependencies after upgrading Node.js or changing your operating system. Run it in your project directory: `npm rebuild`.