conventional-changelog/conventional-changelog

Issue while running conventional-recommended-bump with npx

Closed this issue · 2 comments

 npx -p conventional-recommended-bump -p conventional-changelog-angular -c 'conventional-recommended-bump -p angular'
npm ERR! Cannot read properties of undefined (reading 'replace')

full logs
0 verbose cli [
0 verbose cli   '/usr/local/Cellar/node/22.1.0/bin/node',
0 verbose cli   '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli   'exec',
0 verbose cli   '--package',
0 verbose cli   'conventional-recommended-bump',
0 verbose cli   '--package',
0 verbose cli   'conventional-changelog-angular',
0 verbose cli   '--call',
0 verbose cli   'conventional-recommended-bump -p angular'
0 verbose cli ]
1 info using npm@8.5.5
2 info using node@v22.1.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file: <REDACTED>/.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:<REDACTED>.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/local/Cellar/node/22.1.0/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 9ms
19 timing npm:load:configload Completed in 9ms
20 timing npm:load:setTitle Completed in 4ms
21 timing config:load:flatten Completed in 4ms
22 timing npm:load:display Completed in 7ms
23 verbose logfile <REDACTED>/.npm/_logs/2024-05-09T09_06_25_658Z-debug-0.log
24 timing npm:load:logFile Completed in 5ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 26ms
28 silly logfile start cleaning logs, removing 1 files
29 http fetch GET 200 https://registry.npmjs.org/conventional-recommended-bump 218ms (cache revalidated)
30 timing arborist:ctor Completed in 0ms
31 timing arborist:ctor Completed in 0ms
32 timing arborist:ctor Completed in 0ms
33 timing command:exec Completed in 424ms
34 verbose stack TypeError: Cannot read properties of undefined (reading 'replace')
34 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:166:47
34 verbose stack     at Array.map (<anonymous>)
34 verbose stack     at exec (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:166:31)
34 verbose stack     at async module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:66:5)
35 verbose cwd <REDACTED>
36 verbose Darwin 23.4.0
37 verbose argv "/usr/local/Cellar/node/22.1.0/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--package" "conventional-recommended-bump" "--package" "conventional-changelog-angular" "--call" "conventional-recommended-bump -p angular"
38 verbose node v22.1.0
39 verbose npm  v8.5.5
40 error Cannot read properties of undefined (reading 'replace')
41 verbose exit 1
42 timing npm Completed in 665ms
43 verbose code 1
44 error A complete log of this run can be found in:
44 error     <REDACTED>/.npm/_logs/2024-05-09T09_06_25_658Z-debug-0.log

But seems working fine with previous versions:

 npx -p conventional-recommended-bump@9 -p conventional-changelog-angular@7 -c 'conventional-recommended-bump -p angular'
patch

Is this a bug? Or I'm doing something wrong?

@mbiagetti Hi. It look like problem with npm, not conventional-changelog packages

verbose stack TypeError: Cannot read properties of undefined (reading 'replace')
34 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:166:47
34 verbose stack     at Array.map (<anonymous>)
34 verbose stack     at exec (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:166:31)
34 verbose stack     at async module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:66:5)

@dangreen you're right: I'm not able to reproduce using docker images:

docker run -it -v "$PWD":/usr/src/app -w /usr/src/app docker.io/library/node:20-bullseye  npx -p conventional-recommended-bump -p conventional-changelog-angular -c 'conventional-recommended-bump -p angular'
Need to install the following packages:
conventional-recommended-bump@10.0.0
conventional-changelog-angular@8.0.0
Ok to proceed? (y) y
minor