Skip to content

Switch from npm to pnpm

Pnpm is now the recommended tool to manage Javascript dependencies in InvenioRDM (don't worry npm still works) because it is much faster, has better protection against supply chain attacks, and has good community support.

  1. Locally, install pnpm version 11 (working version at time of writing).

  2. Make sure to set "pnpm" as your invenio javascript package manager in .invenio.

    [cli]
    # set this line
    javascript_package_manager = pnpm
    
  3. In your invenio.cfg, set:

    WEBPACKEXT_NPM_PKG_CLS = "pynpm:PNPMPackage"
    

    to make sure pnpm is used by assets building commands inside and outside your containers.

That's it, faster JavaScript package resolutions are yours now!

Not switching to pnpm

You can keep using npm to manage JS dependencies. To do so, verify that the following are set:

  1. "npm" is set as your invenio javascript package manager in .invenio.

    [cli]
    javascript_package_manager = npm
    
  2. In your invenio.cfg, set:

    # The default is "pynpm:NPMPackage" but may change in a future major version
    WEBPACKEXT_NPM_PKG_CLS = "pynpm:NPMPackage"