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

there are some problems with getting the packageName under monorepo #933

Wxh16144 opened this issue Aug 22, 2022 · 4 comments


Copy link

I feel a bit similar to this problem with #641 , but I can't solve it. Hope to get help。

I have provided a repo that reproduces my problem. repo-link

Copy link

webpro commented Aug 22, 2022

Does it work as expected with npm?

Copy link

No, the terminal prints an error.

error log ``` ➜ nr -F foo release

foo@1.0.0 release /Users/wuxh/Code/StudyProject/releast-it-bug-repo/packages/foo
release-it --config ../../release-it.js --ci

WARNING Unable to verify if user wuxh is a collaborator for foo.
WARNING Latest version in registry (1.0.1) does not match package.json (1.0.0).
ERROR Unable to render template with context:
{"repo":{"host":"","owner":"Wxh16144","project":"releast-it-bug-repo","protocol":"ssh","remote":"","repository":"Wxh16144/releast-it-bug-repo"},"commitMessage":"release: ${version}","tagAnnotation":"Release ${version}\n\n${changelog}","tagName":"${name}@${version}","push":true,"pushRepo":"origin","changelog":"git log --pretty=format:"* %s (%h)" ${from}...${to}","requireCleanWorkingDir":true,"requireBranch":false,"requireUpstream":true,"requireCommits":false,"addUntrackedFiles":false,"commit":true,"commitArgs":[],"tag":true,"tagMatch":null,"tagArgs":[],"pushArgs":["--follow-tags"],"branchName":"master","version":"*"}
ERROR ReferenceError: name is not defined
at eval (lodash.templateSources[8]:9:10)
at format (file:///Users/wuxh/Code/StudyProject/releast-it-bug-repo/node_modules/.pnpm/release-it@15.3.0/node_modules/release-it/lib/util.js:27:32)
at Git.getLatestTagName (file:///Users/wuxh/Code/StudyProject/releast-it-bug-repo/node_modules/.pnpm/release-it@15.3.0/node_modules/release-it/lib/plugin/GitBase.js:93:19)
at Git.init (file:///Users/wuxh/Code/StudyProject/releast-it-bug-repo/node_modules/.pnpm/release-it@15.3.0/node_modules/release-it/lib/plugin/GitBase.js:15:34)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Git.init (file:///Users/wuxh/Code/StudyProject/releast-it-bug-repo/node_modules/.pnpm/release-it@15.3.0/node_modules/release-it/lib/plugin/git/Git.js:40:5)
at async runLifeCycleHook (file:///Users/wuxh/Code/StudyProject/releast-it-bug-repo/node_modules/.pnpm/release-it@15.3.0/node_modules/release-it/lib/index.js:46:28)
at async runTasks (file:///Users/wuxh/Code/StudyProject/releast-it-bug-repo/node_modules/.pnpm/release-it@15.3.0/node_modules/release-it/lib/index.js:57:7)
ERROR name is not defined
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  foo@1.0.0 release: release-it --config ../../release-it.js --ci
Exit status 1
 WARN  Local package.json exists, but node_modules missing, did you mean to install?


@webpro webpro closed this as completed in 627763f Aug 24, 2022
Copy link

webpro commented Aug 24, 2022

Thanks for the reproducible test case, it helps a lot.

The docs were a bit unfortunate, a mistake on my end. It should be fixed now, but you need to change name to in the tagName (only after the init phase of all plugins the generic name is available).

This is released in v15.4.0.

Copy link

Thank you very much for your reply, great contribution to open source. I will try again.

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

No branches or pull requests

2 participants