Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm monorepo unable to run npm pack on Windows #230

Open
userquin opened this issue Dec 10, 2024 · 0 comments
Open

pnpm monorepo unable to run npm pack on Windows #230

userquin opened this issue Dec 10, 2024 · 0 comments

Comments

@userquin
Copy link

Trying to add attw --pack scripts to check types at https://github.com/unocss/unocss doesn't work on Windows machine. UnoCSS is a pnpm monorepo but npm pack fails with this error when running pnpm attw --pack . in the preset-icons folder (node 20.10.0 LTS):

D:\work\unocsss\packages\preset-icons>pnpm attw --pack .
error while checking file:
Command failed: npm pack
D:\work\unocsss\packages\preset-icons>npm pack              
npm ERR! Cannot set properties of null (setting 'peer')

npm ERR! A complete log of this run can be found in: C:\Users\Joaquín\AppData\Local\npm-cache\_logs\2024-12-10T15_23_07_374Z-debug-0.log
2024-12-10T15_23_07_374Z-debug-0.log
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm@10.2.3
2 info using node@v20.10.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\work\nvm\v20.10.0\node_modules\npm\npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:D:\work\unocsss\packages\preset-icons\.npmrc Completed in 0ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:C:\Users\Joaquín\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 0ms
16 timing config:load Completed in 7ms
17 timing npm:load:configload Completed in 7ms
18 timing config:load:flatten Completed in 1ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm pack
22 verbose argv "pack"
23 timing npm:load:setTitle Completed in 1ms
24 timing npm:load:display Completed in 0ms
25 verbose logfile logs-max:10 dir:C:\Users\Joaquín\AppData\Local\npm-cache\_logs\2024-12-10T15_23_07_374Z-
26 verbose logfile C:\Users\Joaquín\AppData\Local\npm-cache\_logs\2024-12-10T15_23_07_374Z-debug-0.log
27 timing npm:load:logFile Completed in 6ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 31ms
31 silly logfile start cleaning logs, removing 2 files
32 silly logfile done cleaning log files
33 timing arborist:ctor Completed in 0ms
34 timing command:pack Completed in 3204ms
35 verbose stack TypeError: Cannot set properties of null (setting 'peer')
35 verbose stack     at visit (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\@npmcli\arborist\lib\calc-dep-flags.js:101:54)
35 verbose stack     at visitNode (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\treeverse\lib\depth-descent.js:58:25)
35 verbose stack     at next (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\treeverse\lib\depth-descent.js:44:19)
35 verbose stack     at depth (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\treeverse\lib\depth-descent.js:83:10)
35 verbose stack     at depth (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\treeverse\lib\depth.js:27:12)
35 verbose stack     at unsetFlag (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\@npmcli\arborist\lib\calc-dep-flags.js:96:5)
35 verbose stack     at C:\work\nvm\v20.10.0\node_modules\npm\node_modules\@npmcli\arborist\lib\calc-dep-flags.js:63:7
35 verbose stack     at Map.forEach (<anonymous>)
35 verbose stack     at calcDepFlagsStep (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\@npmcli\arborist\lib\calc-dep-flags.js:41:17)
35 verbose stack     at calcDepFlagsStep (C:\work\nvm\v20.10.0\node_modules\npm\node_modules\@npmcli\arborist\lib\calc-dep-flags.js:38:12)
36 verbose cwd D:\work\unocsss\packages\preset-icons
37 verbose Windows_NT 10.0.19045
38 verbose node v20.10.0
39 verbose npm  v10.2.3
40 error Cannot set properties of null (setting 'peer')
41 verbose exit 1
42 timing npm Completed in 3393ms
43 verbose code 1
44 error A complete log of this run can be found in: C:\Users\Joaquín\AppData\Local\npm-cache\_logs\2024-12-10T15_23_07_374Z-debug-0.log

Maybe we can use the package manager to generate the tgz via https://github.com/antfu-collective/package-manager-detector.

I'm patching the CLI to use pnpm pack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant