Skip to content

Don't fail on pnpm install without a package.json #53

Description

@rstacruz

Doing pnpm install in a path without package.json shows a cryptic error message and exits with code 1.

~ $ cd /tmp
/tmp $ pnpm i

 ! Cannot read property 'dependencies' of undefined

For comparison, npm is also a little strange in its behavior in this case, but it at least exits successfully:

/tmp $ npm i
npm WARN enoent ENOENT: no such file or directory, open '/private/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.

# node_modules will be enumerated here, if it exists

Related #47.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions