Vscode-vsce: Support pnpm

Created on 11 Feb 2020  ยท  6Comments  ยท  Source: microsoft/vscode-vsce

I tried publishing my extension but recently switched to use pnpm instead of npm. vsce seems to not support this package manager (does yarn even works, very similar to pnpm) since it tries to do npm list --production --parseable --depth=99999 which fails in pnpm projects because of the different handling of dependencies.

Project: https://github.com/muuvmuuv/vscode-sundial

Error:

โฏ npm list --production --parseable --depth=99999
/Users/marvinheilemann/Development/VSCode/vscode-sundial
/Users/marvinheilemann/Development/VSCode/vscode-sundial/node_modules/dayjs
/Users/marvinheilemann/Development/VSCode/vscode-sundial/node_modules/got
/Users/marvinheilemann/Development/VSCode/vscode-sundial/node_modules/public-ip
/Users/marvinheilemann/Development/VSCode/vscode-sundial/node_modules/suncalc
npm ERR! missing: @sindresorhus/is@^1.0.0, required by [email protected]
npm ERR! missing: @szmarczak/http-timer@^4.0.0, required by [email protected]
npm ERR! missing: @types/cacheable-request@^6.0.1, required by [email protected]
npm ERR! missing: cacheable-lookup@^2.0.0, required by [email protected]
npm ERR! missing: cacheable-request@^7.0.1, required by [email protected]
npm ERR! missing: decompress-response@^5.0.0, required by [email protected]
npm ERR! missing: duplexer3@^0.1.4, required by [email protected]
npm ERR! missing: get-stream@^5.0.0, required by [email protected]
npm ERR! missing: lowercase-keys@^2.0.0, required by [email protected]
npm ERR! missing: mimic-response@^2.0.0, required by [email protected]
npm ERR! missing: p-cancelable@^2.0.0, required by [email protected]
npm ERR! missing: p-event@^4.0.0, required by [email protected]
npm ERR! missing: responselike@^2.0.0, required by [email protected]
npm ERR! missing: to-readable-stream@^2.0.0, required by [email protected]
npm ERR! missing: type-fest@^0.9.0, required by [email protected]
npm ERR! missing: dns-socket@^4.2.0, required by [email protected]
npm ERR! missing: got@^9.6.0, required by [email protected]
npm ERR! missing: is-ip@^3.1.0, required by [email protected]
feature-request help wanted

Most helpful comment

Having this problem too. I don't want to mix many package managers in a single project

All 6 comments

Equivalent command would be: pnpm list --prod --json (yarn uses the same)

I guess this requires some rework of the npm.ts script. There is a package that checks which pm was used, maybe something to consider: https://github.com/zkochan/packages/tree/master/which-pm

I've been looking at how to make this work. The main issue is that pnpm makes heavy use of symlinks which won't work with the vsix compression, which is just PKZIP.

I've been able to get it to fully work with pnpm install --shamefully-hoist, but that seems less than ideal.

Having this problem too. I don't want to mix many package managers in a single project

I just ended up using yarn for my vscode extension, while using pnpm for everything else. Hopefully this will be solved soon.

vsce should be package manager agnostic. Having it using npm instead of using whatever the dev has is far from ideal. I had to use npm when I use pnpm for everything else:

pnpm i
vsce publish # error

npm ci
vsce publish #works

This worked on previous versions of vsce, so the change mush be kinda recent.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kobelobster picture kobelobster  ยท  4Comments

Jakobud picture Jakobud  ยท  4Comments

iliazeus picture iliazeus  ยท  6Comments

vazexqi picture vazexqi  ยท  4Comments

felixfbecker picture felixfbecker  ยท  6Comments