Node.js Selector can now keep one copy of each npm package version on a server and share it with every application that uses it. With the new Shared node_modules Store, a package version that one application has already installed isn’t downloaded or stored again for the next. The server links the same files into each application’s node_modules folder.
Account owners who run Node.js applications through Node.js Selector don’t change anything. They still click Run NPM Install in the panel or run npm install, and their applications keep running on the Node.js version they selected.
The Shared Store is in beta and included in every CloudLinux license tier.
The Shared Store keeps package files in a shared cache on the server, owned by root. Applications get them through hardlinks, so one file on disk appears in every application that uses it. Accounts can read the shared files but can’t change them.
The cl-bun package provides the install engine, while applications still run on their selected Node.js version.
Packages that need extra setup or a build are not shared. They get private copies for each application, and their install scripts run as the account user.
npm install with no package name, which installs everything the application’s package.json lists. Other commands that change dependencies, such as npm install , npm update and npm ci, bypass the Shared Store and install packages the usual way, with a separate copy for the application. Since shared files can’t be changed, these commands first replace the application’s shared files with private copies, which count toward the account’s quota. The next full install can share them again.cloudlinux-selector migrate, which keeps the old dependencies until the application passes a health check.chown or chmod over a home or its node_modules also changes the shared files, because a hardlink is the same file in every application that uses it. cl-node-modules-storage status warns when it finds this.The Shared Store is off by default, so just installing the update doesn’t turn it on.
yum install lvemanager cl-bun --enablerepo=cloudlinux-updates-testingcl-node-modules-storage enable (If account homes are on a separate /home filesystem, add --storage-path /home/.cl-node-modules-storage to the enable command.)cl-node-modules-storage status, and look for feature_status: enabled.The Shared node_modules Store documentation covers configuration, converting existing applications, monitoring and cleanup. This is a beta, so tell us how it runs on your servers in this short form, and if you need any further assistance, contact our support team.
Comments