Explore how pnpm 10 enhances package installation security and changes default behaviors for JavaScript projects. This quiz covers new features that increase trust, prevent supply-chain attacks, and improve workflow control.
What is a major change to install scripts introduced in pnpm 10?
Explanation: pnpm 10 stops preinstall and postinstall scripts from running automatically, requiring explicit developer approval to run. Running scripts twice is not a new behavior. Scripts are not permanently disabled; they can be enabled as needed. Only postinstall scripts running automatically is incorrect; neither preinstall nor postinstall scripts run without permission.
How does the minimumReleaseAge feature in pnpm 10 improve security?
Explanation: minimumReleaseAge forces a delay so new packages (less than 24 hours old) are not installed automatically, reducing the risk from rapid attacks. Weekend bans, hourly updates, and sorting by age are not mentioned as features and do not address supply-chain risk directly.
Why are supply chain risks especially serious in the JavaScript ecosystem?
Explanation: Security challenges increase with millions of interdependent packages, allowing a single compromised dependency to have widespread impact. Code compilation is unrelated, and the use or vulnerability status of JavaScript packages is not absolute or exclusive to certain companies.
What does pnpm 10's no-downgrade trust policy achieve?
Explanation: The no-downgrade policy blocks automatic downgrades to earlier versions, which could reintroduce vulnerabilities. Automatic deletion, update disabling, and typo resolution are not aims of the no-downgrade trust feature.
How does pnpm 10 handle exotic transitive dependencies?
Explanation: pnpm 10 blocks exotic and suspicious transitive dependency paths, enhancing security by reducing attack surface. The other choices are incorrect; pnpm does not remove or reinstall dependencies arbitrarily or allow all possible dependency structures by default.
What initial effect might teams notice when using pnpm 10 for installs?
Explanation: Teams may experience install failures for packages that expect install scripts to run automatically, requiring approval. No changes, speed increases, and forced downgrades are not described results of pnpm 10's security updates.
How does pnpm 10 shift responsibility for package safety?
Explanation: pnpm 10 enforces conservative defaults but gives developers the ability to make explicit security choices. Automatic approvals and determination of safety are contrary to the product's approach, and hiding logs is not mentioned.
Besides security, what new feature is introduced in pnpm 10?
Explanation: The introduction of a global virtual store means dependencies are shared more efficiently across projects. Nightly audits, full removal of scripts, and version color coding are not described as features of this release.