question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publishing errors with "Cannot find module '@octokit/request-error'"

See original GitHub issue

Expected 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.

github-client

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
evocateurcommented, Jun 15, 2019

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 under node_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).

0reactions
rahuljain-ttcommented, May 29, 2020

I am also facing same issue @morewry can you help me how you fix this? I tried below steps

  • lerna clean (to delete all node_modules in child packages)
  • deleted all package.lock file manually
  • lerna version --conventional-commits --create-release github

Tag were create on github but release is not there. lerna

Read more comments on GitHub >

github_iconTop Results From Across the Web

@octokit/request-error - npm
Error class for Octokit request errors. Latest version: 3.0.2, last published: 2 months ago. Start using @octokit/request-error in yourΒ ...
Read more >
@octokit-next/request-error - NPM Package Overview - Socket
Error class for Octokit request errors. Version: 2.6.0 was published by octokit-next-bot. Start using Socket to analyze @octokit-next/request-error and itsΒ ...
Read more >
Top 5 @octokit/request-error Code Examples - Snyk
To help you get started, we've selected a few @octokit/request-error examples, based on popular ways it is used in public projects. Secure your...
Read more >
node-github - Bountysource
Created 3 years ago in octokit/octokit.js with 9 comments. ... When trying to import in deno, a lot of missing dependency errors are...
Read more >
node.js - Getting getaddrinfo ENOTFOUND hostname error
An error occurred while running semantic-release: getaddrinfo ... Loaded plugin "publish" from "@semantic-release/github" [3:18:31 PM]Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found