question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate if pnpm should be used instead of npm

See original GitHub issue

Using the Business App Starter and the package.json files mvn install produce I see the following

Reinstalling node_modules using npm in this project takes

$ rm -rf node_modules && time npm i
real	0m12.083s

and running npm install without removing node_modules:

$ time npm i
real	0m5.214s

With pnpm the numbers are

$ rm -rf node_modules && time pnpm i
real	0m5.820s

and without removing node_modules:

$ time pnpm i
real	0m1.429s

I would assume the difference is much larger with a slow network.

Additionally the size of node_modules with pnpm is 82MB while the size when using npm is 173MB

Package files for reference

$ cat package.json 
{
  "name": "no-name",
  "license": "UNLICENSED",
  "dependencies": {
    "@polymer/polymer": "3.2.0",
    "@webcomponents/webcomponentsjs": "^2.2.10",
    "@vaadin/flow-deps": "./target/frontend"
  },
  "devDependencies": {
    "webpack": "4.30.0",
    "webpack-cli": "3.3.0",
    "webpack-dev-server": "3.3.0",
    "webpack-babel-multi-target-plugin": "2.1.0",
    "copy-webpack-plugin": "5.0.3",
    "webpack-merge": "4.2.1",
    "raw-loader": "3.0.0"
  }
}
$ cat target/frontend/package.json 
{
  "name": "@vaadin/flow-deps",
  "version": "1.0.0",
  "license": "UNLICENSED",
  "dependencies": {
    "@vaadin/vaadin-crud": "1.0.5",
    "@vaadin/vaadin-icons": "4.3.1",
    "@vaadin/vaadin-grid": "5.4.6",
    "@vaadin/vaadin-split-layout": "4.1.1",
    "@vaadin/vaadin-combo-box": "5.0.6",
    "@vaadin/vaadin-cookie-consent": "1.1.1",
    "@vaadin/vaadin-core-shrinkwrap": "14.0.0-rc7",
    "@vaadin/vaadin-upload": "4.2.2",
    "@vaadin/vaadin-dialog": "2.2.1",
    "@vaadin/vaadin-select": "2.1.5",
    "@vaadin/vaadin-app-layout": "2.0.2",
    "@vaadin/vaadin-item": "2.1.0",
    "@vaadin/vaadin-board": "2.1.0",
    "@vaadin/vaadin-charts": "6.2.3",
    "@vaadin/vaadin-notification": "1.4.0",
    "@vaadin/vaadin-grid-pro": "2.0.3",
    "@vaadin/vaadin-progress-bar": "1.1.2",
    "@vaadin/vaadin-shrinkwrap": "14.0.0-rc7",
    "@vaadin/vaadin-ordered-layout": "1.1.0",
    "@vaadin/vaadin-login": "1.0.1",
    "@vaadin/vaadin-button": "2.2.1",
    "@vaadin/vaadin-date-picker": "4.0.3",
    "@vaadin/vaadin-text-field": "2.4.8",
    "@vaadin/vaadin-menu-bar": "1.0.3",
    "@vaadin/vaadin-custom-field": "1.0.6",
    "@vaadin/vaadin-form-layout": "2.1.4",
    "@vaadin/vaadin-confirm-dialog": "1.1.4",
    "@vaadin/vaadin-accordion": "1.0.1",
    "@polymer/iron-list": "3.0.2",
    "@vaadin/vaadin-list-box": "1.1.1",
    "@vaadin/vaadin-details": "1.0.1",
    "@vaadin/vaadin-checkbox": "2.2.10",
    "@polymer/iron-icon": "3.0.1",
    "@vaadin/vaadin-time-picker": "2.0.2",
    "@vaadin/vaadin-context-menu": "4.3.12",
    "@vaadin/vaadin-tabs": "3.0.4",
    "@vaadin/vaadin-radio-button": "1.2.3",
    "@vaadin/vaadin-lumo-styles": "1.5.0",
    "@vaadin/vaadin-material-styles": "1.2.3",
    "@vaadin/vaadin-rich-text-editor": "1.0.4"
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
heruancommented, Oct 29, 2019

Thank you @caalador for the explanation. Let me express my humble opinion: after a couple of months working with V14+NPM I can say I’d prefer having a single package.json, updated by the plugin when needed, to know which modules I’m actually depending on and to keep them tracked on version control.

1reaction
plekucommented, Nov 20, 2019

Closing this as the investigation has concluded and pnpm support will be WIP soon (#6966)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use PNPM instead of NPM, Yarn - DEV Community ‍ ‍
Conclusion. pnpm is faster and handles the disk memory more efficiently than npm and yarn. This gives us lots of free space when...
Read more >
pnpm vs npm
On the other hand, pnpm manages node_modules by using hard linking and symbolic linking to a global on-disk content-addressable store.
Read more >
Stop Using NPM/Yarn. Use PNPM Instead - Bits and Pieces
Here's a reference to the performance comparison chart provided by the official website, you can see that pnpm's performance is quite good. Although...
Read more >
JavaScript package managers compared: npm, Yarn, or pnpm?
With the spate of popular JavaScript package managers reaching relative feature parity, it's time to compare: npm, Yarn, or pnpm?
Read more >
Use pnpm instead of npm or yarn for JavaScript & TypeScript
pnpm is a fast, disk efficient package manager for the JavaScript ecosystem. When using npm or Yarn, if you have 100 projects using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found