Publishing errors with "Cannot find module '@octokit/request-error'"
See original GitHub issueExpected Behavior
No error, packages are versioned and published to npm.
Current Behavior
I canβt publish anymore. I published last on Tuesday Jun 11 and in the meantime we unlocked and let a bunch of minor and patch updates come through. Now all lerna publish
commands error:
Cannot find module '@octokit/request-error'
Not great, but especially weird given the type of release Iβm really trying to make right now. We have a type of pre-release we make that we call a βquick pre-release.β The objective is to create a timestamped pre-release that goes to npm, skipping all git-related stuff. The command weβve been using is:
lerna publish prerelease --no-git-tag-version --no-push --npm-tag=quick --preid=$(date '+%Y%m%d%H%M%S')-quick --force-publish --yes --allow-branch quick/*
After getting the error, I also attempted this frantic everything-and-the-kitchen-sink variation after reviewing the documentation and noticing some new features since I wrote the original.
npx lerna publish prerelease --no-git-tag-version --no-push --dist-tag=quick --preid=$(date '+%Y%m%d%H%M%S')-quick --force-publish --yes --allow-branch quick/* --no-verify-registry --ignore-scripts --ignore-prepublish --no-git-reset --no-commit-hooks --no-changelog
Possible Solution
If I go into @lerna/github-client
and comment out all the octokit-rest
lines, I am able to get past the error and make my quick pre-release. See screenshot.
Obviously, I kinda need to be able to do normal releases that do involve git & GitHub, but it seems a little weird this code is getting hit when Iβm making such an effort to skip all git-related actions.
Steps to Reproduce (for bugs)
I donβt know how to walk through a reproduction if this error isnβt happening widely to most users. I just have kinda a normal Lerna monorepo setup here. And Iβm just trying to publish. Did a full clean install of all node modules from scratch (wiped everything out, including package locks and installed everything from a clean slate).
lerna.json
{
"command": {
"bootstrap": {
"ci": false,
"hoist": false
},
"exec": {
"stream": true
},
"list": {
"all": true,
"long": true
},
"publish": {
"allowBranch": "master",
"commitHooks": true,
"conventionalCommits": true,
"independent": true,
"message": "chore: publish dls"
},
"run": {
"stream": true
},
"version": {
"allowBranch": "master",
"commitHooks": true,
"conventionalCommits": true,
"independent": true,
"message": "chore: publish dls"
}
},
"ignoreChanges": [
"**/*.md",
"**/.gitignore",
"**/.gitkeep",
"**/__fixtures__/**",
"**/__tests__/**",
"**/fixtures/**",
"**/package-lock.json",
"**/sketch/**",
"**/test/**",
"**/tests/**",
"demos/angular/**",
"demos/bundle/**",
"packages/dls-falcor/demo/**",
"tools/dls-icon-loader/demo/**",
"tools/dls-tokenizer/demo/**"
],
"lerna": "3.11.1",
"packages": [
"components/*",
"components/employer/*",
"components/falcor/*",
"components/member/*",
"demos/*",
"packages/*",
"primitives/*",
"tokens/*",
"tokens/employer/*",
"tokens/falcor/*",
"tokens/member/*",
"tools/*"
],
"version": "independent"
}
lerna-debug.log
None is generated by this error.
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
3.15.0 |
npm --version |
6.9.0 |
node --version |
10.15.0 |
OS | Version |
---|---|
macOS Mojave | 10.14.4 |
These are the seemingly relevant dependency versions involved.
> npm ls lerna
dls@ /Users/rachael.moore/Projects/dls
βββ lerna@3.15.0
> npm ls | grep @lerna
β βββ¬ @lerna/add@3.15.0
β β βββ @lerna/bootstrap@3.15.0 deduped
β β βββ¬ @lerna/command@3.15.0
β β β βββ @lerna/child-process@3.14.2 deduped
β β β βββ @lerna/package-graph@3.14.0 deduped
β β β βββ¬ @lerna/project@3.15.0
β β β β βββ @lerna/package@3.14.2 deduped
β β β β βββ @lerna/validation-error@3.13.0 deduped
β β β βββ @lerna/validation-error@3.13.0 deduped
β β β βββ¬ @lerna/write-log-file@3.13.0
β β βββ¬ @lerna/filter-options@3.14.2
β β β βββ @lerna/collect-updates@3.14.2 deduped
β β β βββ¬ @lerna/filter-packages@3.13.0
β β β β βββ @lerna/validation-error@3.13.0 deduped
β β βββ¬ @lerna/npm-conf@3.13.0
β β βββ¬ @lerna/validation-error@3.13.0
β βββ¬ @lerna/bootstrap@3.15.0
β β βββ¬ @lerna/batch-packages@3.14.0
β β β βββ @lerna/package-graph@3.14.0 deduped
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/filter-options@3.14.2 deduped
β β βββ¬ @lerna/has-npm-version@3.14.2
β β β βββ @lerna/child-process@3.14.2 deduped
β β βββ¬ @lerna/npm-install@3.14.2
β β β βββ @lerna/child-process@3.14.2 deduped
β β β βββ¬ @lerna/get-npm-exec-opts@3.13.0
β β βββ¬ @lerna/package-graph@3.14.0
β β β βββ @lerna/prerelease-id-from-version@3.14.0 deduped
β β β βββ @lerna/validation-error@3.13.0 deduped
β β βββ¬ @lerna/pulse-till-done@3.13.0
β β βββ¬ @lerna/rimraf-dir@3.14.2
β β β βββ @lerna/child-process@3.14.2 deduped
β β βββ¬ @lerna/run-lifecycle@3.14.0
β β β βββ @lerna/npm-conf@3.13.0 deduped
β β βββ¬ @lerna/run-parallel-batches@3.13.0
β β βββ¬ @lerna/symlink-binary@3.14.2
β β β βββ¬ @lerna/create-symlink@3.14.0
β β β βββ¬ @lerna/package@3.14.2
β β βββ¬ @lerna/symlink-dependencies@3.14.2
β β β βββ @lerna/create-symlink@3.14.0 deduped
β β β βββ¬ @lerna/resolve-symlink@3.13.0
β β β βββ @lerna/symlink-binary@3.14.2 deduped
β β βββ @lerna/validation-error@3.13.0 deduped
β βββ¬ @lerna/changed@3.15.0
β β βββ¬ @lerna/collect-updates@3.14.2
β β β βββ @lerna/child-process@3.14.2 deduped
β β β βββ @lerna/describe-ref@3.14.2 deduped
β β βββ @lerna/command@3.15.0 deduped
β β βββ¬ @lerna/listable@3.14.0
β β β βββ¬ @lerna/query-graph@3.14.0
β β β β βββ @lerna/package-graph@3.14.0 deduped
β β βββ¬ @lerna/output@3.13.0
β β βββ @lerna/version@3.15.0 deduped
β βββ¬ @lerna/clean@3.15.0
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/filter-options@3.14.2 deduped
β β βββ¬ @lerna/prompt@3.13.0
β β βββ @lerna/pulse-till-done@3.13.0 deduped
β β βββ @lerna/rimraf-dir@3.14.2 deduped
β βββ¬ @lerna/cli@3.13.0
β β βββ @lerna/global-options@3.13.0
β βββ¬ @lerna/create@3.15.0
β β βββ¬ @lerna/child-process@3.14.2
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/npm-conf@3.13.0 deduped
β β βββ @lerna/validation-error@3.13.0 deduped
β βββ¬ @lerna/diff@3.15.0
β β βββ @lerna/child-process@3.14.2 deduped
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/validation-error@3.13.0 deduped
β βββ¬ @lerna/exec@3.15.0
β β βββ @lerna/child-process@3.14.2 deduped
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/filter-options@3.14.2 deduped
β β βββ¬ @lerna/run-topologically@3.14.0
β β β βββ @lerna/query-graph@3.14.0 deduped
β β βββ @lerna/validation-error@3.13.0 deduped
β βββ¬ @lerna/import@3.15.0
β β βββ @lerna/child-process@3.14.2 deduped
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/prompt@3.13.0 deduped
β β βββ @lerna/pulse-till-done@3.13.0 deduped
β β βββ @lerna/validation-error@3.13.0 deduped
β βββ¬ @lerna/init@3.15.0
β β βββ @lerna/child-process@3.14.2 deduped
β β βββ @lerna/command@3.15.0 deduped
β βββ¬ @lerna/link@3.15.0
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/package-graph@3.14.0 deduped
β β βββ @lerna/symlink-dependencies@3.14.2 deduped
β βββ¬ @lerna/list@3.15.0
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/filter-options@3.14.2 deduped
β β βββ @lerna/listable@3.14.0 deduped
β β βββ @lerna/output@3.13.0 deduped
β βββ¬ @lerna/publish@3.15.0
β β βββ¬ @lerna/check-working-tree@3.14.2
β β β βββ¬ @lerna/collect-uncommitted@3.14.2
β β β β βββ @lerna/child-process@3.14.2 deduped
β β β βββ @lerna/describe-ref@3.14.2 deduped
β β β βββ @lerna/validation-error@3.13.0 deduped
β β βββ @lerna/child-process@3.14.2 deduped
β β βββ @lerna/collect-updates@3.14.2 deduped
β β βββ @lerna/command@3.15.0 deduped
β β βββ¬ @lerna/describe-ref@3.14.2
β β β βββ @lerna/child-process@3.14.2 deduped
β β βββ¬ @lerna/log-packed@3.13.0
β β βββ @lerna/npm-conf@3.13.0 deduped
β β βββ¬ @lerna/npm-dist-tag@3.15.0
β β β βββ¬ @lerna/otplease@3.14.0
β β β β βββ @lerna/prompt@3.13.0 deduped
β β βββ¬ @lerna/npm-publish@3.15.0
β β β βββ @lerna/otplease@3.14.0 deduped
β β β βββ @lerna/run-lifecycle@3.14.0 deduped
β β βββ @lerna/output@3.13.0 deduped
β β βββ¬ @lerna/pack-directory@3.14.2
β β β βββ¬ @lerna/get-packed@3.13.0
β β β βββ @lerna/package@3.14.2 deduped
β β β βββ @lerna/run-lifecycle@3.14.0 deduped
β β βββ¬ @lerna/prerelease-id-from-version@3.14.0
β β βββ @lerna/prompt@3.13.0 deduped
β β βββ @lerna/pulse-till-done@3.13.0 deduped
β β βββ @lerna/run-lifecycle@3.14.0 deduped
β β βββ @lerna/run-topologically@3.14.0 deduped
β β βββ @lerna/validation-error@3.13.0 deduped
β β βββ @lerna/version@3.15.0 deduped
β βββ¬ @lerna/run@3.15.0
β β βββ @lerna/command@3.15.0 deduped
β β βββ @lerna/filter-options@3.14.2 deduped
β β βββ¬ @lerna/npm-run-script@3.14.2
β β β βββ @lerna/child-process@3.14.2 deduped
β β β βββ @lerna/get-npm-exec-opts@3.13.0 deduped
β β βββ @lerna/output@3.13.0 deduped
β β βββ @lerna/run-topologically@3.14.0 deduped
β β βββ @lerna/timer@3.13.0
β β βββ @lerna/validation-error@3.13.0 deduped
β βββ¬ @lerna/version@3.15.0
β β βββ @lerna/check-working-tree@3.14.2 deduped
β β βββ @lerna/child-process@3.14.2 deduped
β β βββ @lerna/collect-updates@3.14.2 deduped
β β βββ @lerna/command@3.15.0 deduped
β β βββ¬ @lerna/conventional-commits@3.14.0
β β β βββ @lerna/validation-error@3.13.0 deduped
β β βββ¬ @lerna/github-client@3.14.2
β β β βββ @lerna/child-process@3.14.2 deduped
β β βββ¬ @lerna/gitlab-client@3.15.0
β β βββ @lerna/output@3.13.0 deduped
β β βββ @lerna/prerelease-id-from-version@3.14.0 deduped
β β βββ @lerna/prompt@3.13.0 deduped
β β βββ @lerna/run-lifecycle@3.14.0 deduped
β β βββ @lerna/run-topologically@3.14.0 deduped
β β βββ @lerna/validation-error@3.13.0 deduped
> npm ls | grep @octo
β β β βββ @octokit/plugin-enterprise-rest@2.2.2
β β β βββ¬ @octokit/rest@16.28.1
β β β β βββ¬ @octokit/request@4.1.0
β β β β β βββ¬ @octokit/endpoint@5.1.5
β β β β β βββ @octokit/request-error@1.0.3 deduped
β β β β βββ¬ @octokit/request-error@1.0.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top GitHub Comments
I find
npm ls -lp <pkgname>
to be more useful when attempting to debug these sorts of things, as it will output the literal path(s) that this package has been unpacked to undernode_modules
, instead of a (potentially) misleading symbolic tree.I do agree that we could be slightly more respectful of folks who donβt use the
--create-release
flag by delaying the require of the module entirely, which would workaround your particular error case. (As far as I can tell, this isnβt actually a problem with Lerna directly, aside from requiring the module that we expect package managers to lay out on disk properly).I am also facing same issue @morewry can you help me how you fix this? I tried below steps
Tag were create on github but release is not there.