npm pnpm 7.0.0-alpha.2
v7.0.0-alpha.2

latest releases: 10.0.0-alpha.0, 9.12.3, 9.12.2...
2 years ago

Major Changes

  • The root package is excluded by default, when running pnpm -r exec|run|add #2769.

  • Filtering by path is done by globs.

    In pnpm v6, in order to pick packages under a certain directory, the following filter was used: --filter=./apps

    In pnpm v7, a glob should be used: --filter=./apps/**

  • The NODE_PATH env variable is not set in the command shims (the files in node_modules/.bin). This env variable was really long and frequently caused errors on Windows.

    Also, the extend-node-path setting is removed.

    Related PR: #4253

  • The embed-readme setting is false by default.

  • When using pnpm run <script>, all command line arguments after the script name are now passed to the script's argv, even --. For example, pnpm run echo --hello -- world will now pass --hello -- world to the echo script's argv. Previously flagged arguments (e.g. --silent) were intepreted as pnpm arguments unless -- came before it.

  • Side effects cache is turned on by default. To turn it off, use side-effects-cache=false.

  • The npm_config_argv env variable is not set for scripts #4153.

  • pnpx is now just an alias of pnpm dlx.

    If you want to just execute the command of a dependency, run pnpm <cmd>. For instance, pnpm eslint.

    If you want to install and execute, use pnpm dlx <pkg name>.

  • pnpm install -g pkg will add the global command only to a predefined location. pnpm will not try to add a bin to the global Node.js or npm folder. To set the global bin directory, either set the PNPM_HOME env variable or the global-bin-dir setting.

  • pnpm pack should only pack a file as an executable if it's a bin or listed in the publishConfig.executableFiles array.

  • -W is not an alias of --ignore-workspace-root-check anymore. Just use -w or --workspace-root instead, which will also allow to install dependencies in the root of the workspace.

Minor Changes

  • -F is a short alias of --filter #3467.

  • A new setting is supported in the pnpm section of the package.json file #4001. onlyBuiltDependencies is an array of package names that are allowed to be executed during installation. If this field exists, only mentioned packages will be able to run install scripts.

    {
      "pnpm": {
        "onlyBuiltDependencies": ["fsevents"]
      }
    }
  • When adding a new dependency, use the version specifier from the overrides, when present #4313.

    Normally, if the latest version of foo is 2.0.0, then pnpm add foo installs foo@^2.0.0. This behavior changes if foo is specified in an override:

    {
      "pnpm": {
        "overrides": {
          "foo": "1.0.0"
        }
      }
    }

    In this case, pnpm add foo will add foo@1.0.0 to the dependency. However, if a version is explicitly specifying, then the specified version will be used and the override will be ignored. So pnpm add foo@0 will install v0 and it doesn't matter what is in the overrides.

What's Changed

New Contributors

Full Changelog: v6.31.0...v7.0.0-alpha.2

Don't miss a new pnpm release

NewReleases is sending notifications on new releases.