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

Lerna bootstrap throws error when failing to install optional dependency. #1032

Closed
spoldman opened this issue Sep 28, 2017 · 9 comments · Fixed by #1041
Closed

Lerna bootstrap throws error when failing to install optional dependency. #1032

spoldman opened this issue Sep 28, 2017 · 9 comments · Fixed by #1041

Comments

@spoldman
Copy link

I have been trying to use a package that has invalid semver in package.json optional dependencies but it always fails. This only fails when I run the lerna bootstrap command not the yarn install.

For some context I'm using yarn workspaces but I think it does not matter

Expected Behavior

Should not throw error on optional dependencies not installing

Current Behavior

This is what I get when running lerna bootstrap:
lerna ERR! execute Error: Command failed: yarn install --mutex network:42424
lerna ERR! execute warning Lockfile has incorrect entry for "oidc-client-fetch@>=1.2.0". Ignoring it.
lerna ERR! execute error Couldn't find any versions for "oidc-client-fetch" that matches ">=1.2.0"

Steps to Reproduce (for bugs)

lerna.json

{
  "lerna": "2.0.0-beta.38",
  "packages": [
    "packages/*"
  ],
  "version": "independent",
  "npmClient": "yarn",
  "useWorkspaces": true,
  "npmClientArgs": [ "--no-optional"]
}

lerna-debug.log

lerna bootstrap --loglevel=silly -- --no-optional
lerna sill input [ '--no-optional' ]
lerna sill flags { _: [ 'bootstrap' ],
lerna sill flags   loglevel: 'silly',
lerna sill flags   args: [ '--no-optional' ] }
lerna verb rootPath C:\Code\Frontend\Cosmic
lerna info version 2.2.0
lerna info versioning independent
lerna sill existsSync C:\Code\Frontend\Cosmic\VERSION
lerna sill initialize attempt
lerna sill initialize success
lerna sill execute attempt
lerna info Bootstrapping 41 packages
lerna sill installInDir Cosmic
lerna sill installInDir C:\Code\Frontend\Cosmic\package.json
lerna sill getExecOpts { cwd: 'C:\\Code\\Frontend\\Cosmic' }
lerna sill installInDir [ 'yarn', [ 'install', '--mutex', 'network:42424' ] ]
lerna ERR! execute Error: Command failed: yarn install --mutex network:42424
lerna ERR! execute warning Lockfile has incorrect entry for "oidc-client-fetch@>=1.2.0". Ignoring it.
lerna ERR! execute error Couldn't find any versions for "oidc-client-fetch" that matches ">=1.2.0"
lerna ERR! execute yarn install v1.1.0
lerna ERR! execute [1/4] Resolving packages...
lerna ERR! execute info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
lerna ERR! execute
lerna ERR! execute     at Promise.all.then.arr (C:\Users\baldurarna\AppData\Roaming\npm\node_modules\lerna\node_modules\execa\index.js:236:11)
lerna ERR! execute     at <anonymous>
lerna ERR! execute     at process._tickCallback (internal/process/next_tick.js:188:7)
lerna ERR! execute  callback with error
lerna ERR! execute  { Error: Command failed: yarn install --mutex network:42424
lerna ERR! execute warning Lockfile has incorrect entry for "oidc-client-fetch@>=1.2.0". Ignoring it.
lerna ERR! execute error Couldn't find any versions for "oidc-client-fetch" that matches ">=1.2.0"
lerna ERR! execute yarn install v1.1.0
lerna ERR! execute [1/4] Resolving packages...
lerna ERR! execute info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
lerna ERR! execute
lerna ERR! execute     at Promise.all.then.arr (C:\Users\baldurarna\AppData\Roaming\npm\node_modules\lerna\node_modules\execa\index.js:236:11)
lerna ERR! execute     at <anonymous>
lerna ERR! execute     at process._tickCallback (internal/process/next_tick.js:188:7)
lerna ERR! execute   stack: 'Error: Command failed: yarn install --mutex network:42424\nwarning Lockfile has incorrect entry for "oidc-client-fetch@>=1.2.0". Ignoring it.\nerror Couldn\'t find any versions for "oidc-client-fetch" that matches ">=1.2.0"\nyarn install v1.1.0\n[1/4] Resolving packages...\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n\n    at Promise.all.then.arr (C:\\Users\\baldurarna\\AppData\\Roaming\\npm\\node_modules\\lerna\\node_modules\\execa\\index.js:236:11)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)',
lerna ERR! execute   code: 1,
lerna ERR! execute   killed: false,
lerna ERR! execute   stdout: 'yarn install v1.1.0\n[1/4] Resolving packages...\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n',
lerna ERR! execute   stderr: 'warning Lockfile has incorrect entry for "oidc-client-fetch@>=1.2.0". Ignoring it.\nerror Couldn\'t find any versions for "oidc-client-fetch" that matches ">=1.2.0"\n',
lerna ERR! execute   failed: true,
lerna ERR! execute   signal: null,
lerna ERR! execute   cmd: 'yarn install --mutex network:42424',
lerna ERR! execute   timedOut: false }

Context

Your Environment

Executable Version
lerna --version 2.2.0
npm --version 5.3.0
yarn --version 1.1.0
node --version 8.3.0
OS Version
Windows 10
@nhducit
Copy link
Contributor

nhducit commented Oct 2, 2017

Change this line "useWorkspaces": true ==>false,
I have a similar issue, after turn off useWorkspaces options, it works.
#1014

@evocateur
Copy link
Member

This isn't actually caused by "useWorkspaces": true, it's just that the separate code path it uses doesn't append npmClientArgs to the install command.

Ideally, that whole "build command, arguments, and options" block would be extracted into a shared function so we don't have to maintain two code paths in the future.

evocateur pushed a commit to evocateur/lerna that referenced this issue Oct 2, 2017
Refactor bootstrap to use same code path for all installs (eventually)
and move internal npmGlobalStyle parameter into options property.

Fixes lerna#1032
evocateur added a commit that referenced this issue Oct 2, 2017
Refactor bootstrap to use same code path for all installs (eventually) and move internal npmGlobalStyle parameter into options property.

Fixes #1032
@hannadrehman
Copy link

I am facing the same issue, what is the fix for this?

Executable Version
lerna --version 2.11.0
npm --version 6.2.0
yarn --version 1.6.0
node --version 9.6.1

| OS | Version |
| macOS High Sierra | 10.13.3-= |

@AlexHuicu
Copy link

AlexHuicu commented Sep 24, 2018

I'm also facing this issue:

lerna -v 2.4.0
npm -v 6.4.1
yarn -v 1.9.4
node -v 10.11.0

macOS High Sierra 10.13.6

@haikyuu
Copy link

haikyuu commented Nov 14, 2018

I was facing this problem because of a missing local dependency. i.e, i was depending on a package in my monorepo but i accidently deleted it.

@ygmarchi
Copy link

I was facing this problem because of a missing local dependency. i.e, i was depending on a package in my monorepo but i accidently deleted it.

Can you explain what you deleted accidentally in what file... I'm facing the same problem and it would be a precious indication on how to solve it.

@haikyuu
Copy link

haikyuu commented Nov 29, 2018

@ygmarchi let me clarify. Here is my project:

|-packages
  |- package 1
  |- package 2

package 1 depends on package 2 and i accidently deleted package 2. That was causing the error for me.

@ygmarchi
Copy link

@haikyuu thanks, actually I've solved my problem, it was due to a bizarre Debian package called cmdtest containing an executable accidentally called also yarn.

@lock
Copy link

lock bot commented Feb 27, 2019

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants