Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

oclif-dev readme fails if package.json has no devDependencies #126

@geelen

Description

@geelen

Using a lerna monorepo & yarn workspaces, I found that moving all my packages' devDependencies up to the root level fixed a bunch of stuff, but when I came to publish versions, oclif-dev readme was exploding with the message:

> @fab/cli@0.0.1 version /Users/glen/src/projects/fab/packages/cli
> oclif-dev readme

replacing <!-- usage --> in README.md
TypeError: Cannot read property 'typescript' of undefined
    at Readme.commandPath (~/src/projects/fab/node_modules/@oclif/dev-cli/lib/commands/readme.js:189:42)
    at Readme.commandCode (~/src/projects/fab/node_modules/@oclif/dev-cli/lib/commands/readme.js:137:32)
    at Readme.renderCommand (~/src/projects/fab/node_modules/@oclif/dev-cli/lib/commands/readme.js:122:18)
    at ~/src/projects/fab/node_modules/@oclif/dev-cli/lib/commands/readme.js:110:39
    at Array.map (<anonymous>)
    at Readme.commands (~/src/projects/fab/node_modules/@oclif/dev-cli/lib/commands/readme.js:110:25)
    at Readme.run (~/src/projects/fab/node_modules/@oclif/dev-cli/lib/commands/readme.js:36:123)
    at Readme._run (~/src/projects/fab/node_modules/@oclif/command/lib/command.js:44:20)
    at Config.runCommand (~/src/projects/fab/node_modules/@oclif/config/lib/config.js:151:9)
    at Main.run (~/src/projects/fab/node_modules/@oclif/command/lib/main.js:21:9)
lerna info lifecycle @fab/cli@0.0.1~version: Failed to exec version script
lerna ERR! lifecycle "version" errored in "@fab/cli", exiting 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Making sure package.json had at least:

  "devDependencies": {
    "@oclif/dev-cli": "^1"
  },

was enough to fix the problem, but it could be fixed inside oclif itself

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions