nodejsnpminstall

May 19, 2026 ยท View on GitHub

Ensures npm is available through the embedded Node.js npm or installs npm from source.

Actions

ActionDescription
:installInstalls npm. Default.
:removeRemoves npm artifacts created by source installs.

Properties

PropertyTypeDefaultDescription
install_methodString'embedded'One of embedded or source.
install_nodetrue, falsetrueInstalls Node.js before npm.
node_install_methodString'package'Node.js install method when install_node is true.
versionString'24.15.0'Node.js version passed to nodejs_install.
prefix_urlString'<https://nodejs.org/dist/'>Node.js artifact base URL passed to nodejs_install.
npm_versionString'latest'npm version resolved from the npm registry for source installs.
npm_urlString, nilnilOverride npm tarball URL.
npm_checksumString, nilnilOptional npm tarball checksum.
make_threadsInteger, String, nilCPU countParallel make jobs for source installs.

Examples

nodejs_npm_install 'npm' do
  install_method 'embedded'
end
nodejs_npm_install 'npm from source' do
  install_method 'source'
  npm_version '11.6.2'
end