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

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

Closed
rstacruz opened this issue Jan 31, 2016 · 2 comments
Closed

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

rstacruz opened this issue Jan 31, 2016 · 2 comments

Comments

@rstacruz
Copy link
Member

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.

@zkochan
Copy link
Member

zkochan commented Feb 23, 2017

Currently pnpm does have a meaningful error message in this situation. It says: ERROR No package.json found

@zkochan zkochan closed this as completed Feb 23, 2017
@jsumners
Copy link

jsumners commented Feb 2, 2018

I routinely do an npm install foo in an empty directory to try out a package. This is functionality I expect to work in any package manager.

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

No branches or pull requests

3 participants