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

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

Open
geelen opened this issue Dec 11, 2019 · 1 comment
Open

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

geelen opened this issue Dec 11, 2019 · 1 comment

Comments

@geelen
Copy link

geelen commented Dec 11, 2019

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

@jonascript
Copy link

This is still an issue. Can confirm that adding @oclif/dev-cli to devDependencies fixes it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants