LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

npm-rebuild

rebuilds native addon modules for the current Node

TLDR

Rebuild all native modules
$ npm rebuild
copy
Rebuild specific package
$ npm rebuild [package]
copy
Rebuild for different Node version
$ npm rebuild --target=[18.0.0]
copy
Rebuild globally installed packages
$ npm rebuild -g
copy

SYNOPSIS

npm rebuild [options] [packages...]

DESCRIPTION

npm rebuild rebuilds native addon modules for the current Node.js version. This is necessary after upgrading Node.js or when native modules fail to load.The command runs node-gyp rebuild for each package with native code.

PARAMETERS

-g, --global

Rebuild global packages.
--ignore-scripts
Don't run scripts.
--foreground-scripts
Run scripts in foreground.

COMMON USE CASES

$ # After Node.js upgrade
npm rebuild

# Fix broken native module
npm rebuild bcrypt

# Rebuild with verbose output
npm rebuild --verbose
copy

NATIVE MODULES

$ bcrypt, node-sass, sqlite3
sharp, canvas, grpc
leveldown, node-rdkafka
copy

INSTALL

sudo pacman -S npm
copy
sudo apk add npm
copy
brew install npm
copy

CAVEATS

Requires build tools (Python, C++ compiler). May take significant time. Some modules need specific Node versions.

HISTORY

npm rebuild has been part of npm since early versions, essential for maintaining native addon compatibility across Node.js versions.

SEE ALSO

npm(1), npm-install(1), node-gyp(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid