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

Compatibility with pnpm #1064

Closed
julien-f opened this issue Oct 4, 2016 · 12 comments
Closed

Compatibility with pnpm #1064

julien-f opened this issue Oct 4, 2016 · 12 comments
Labels

Comments

@julien-f
Copy link

julien-f commented Oct 4, 2016

pnpm is a fast implementation of npm install with the following features:

  • much faster dependencies installation
  • important disk usage reduction
  • installation progress is displayed very nicely

Unfortunately, ava is not compatible with it as pnpm use symlinks to install the deps which makes ava complain:

$ npm test
> @ test issue-ava-pnpm
> ava

WARNING: `npm link ava` and the `--preserve-symlink` flag are incompatible. We have detected that AVA is linked via `npm link`, and that you are using either an early version of Node 6, or the `--preserve-symlink` flag. This breaks AVA. You should upgrade to Node 6.2.0+, avoid the `--preserve-symlink` flag, or avoid using `npm link ava`.

   1 exception


   ✖ No tests found in test.js, make sure to import "ava" at the top of your test file
npm ERR! Test failed.  See above for more details.

Example repository: https://github.com/julien-f/issue-ava-pnpm

It would be very nice if it could be fixed 😄

@sindresorhus
Copy link
Member

Do you run $ node with the --preserve-symlink flag? That's the only time that message should show or if you're using an old v6 version.

@julien-f
Copy link
Author

julien-f commented Oct 5, 2016

Indeed, it seems that pnpm is doing that for all exported binaries.

@julien-f
Copy link
Author

julien-f commented Oct 5, 2016

See pnpm/pnpm#244

//cc @zkochan

@sindresorhus
Copy link
Member

Sounds like a very bad idea. It's a flag for a reason. You should only use it when you control the whole environment.

@zkochan
Copy link

zkochan commented Oct 5, 2016

Using this flag allowed us to install packages to a shared folder. It is unbelievable what amount of disk-space it saves!

Personally I did not experience any problems while using the --preserve-symlink flag. If there is a particular reason why it can't be used with ava, maybe you could add a preserveSymlinks: false to your package.json and pnpm will not force it to preserve-symlinks. Probably ava will work anyway from a shared storage. Preserve symlinks is important mainly for packages with peer dependencies.

cc @pnpm, @iamstarkov, @rstacruz, @andreypopp

@julien-f
Copy link
Author

julien-f commented Oct 5, 2016

@zkochan I'm afraid that requiring users to configure pnpm for their usage will really hurt pnpm as it will no longer be a drop-in replacement for npm i 😒

@zkochan
Copy link

zkochan commented Oct 5, 2016

Well the same we could say about ava, right? Other testing frameworks seem to work with pnpm and the --preserve-symlink flag.

What I suggest is to add a new property to ava's package.json. Users of ava/pnpm won't have to do anything. (I think it would work, I can check later today)

Or we could add a config to pnpm to disable --preserve-symlinks. But that would disallow the usage of a shared store. Would this work for you @julien-f?

@julien-f
Copy link
Author

julien-f commented Oct 5, 2016

@zkochan I only want what's best for pnpm because it's much nicer to use than npm :)

Adding a property to ava's package.json looks like the best approach but it's not up to me (@sindresorhus, what's your opinion on this?).

@zkochan
Copy link

zkochan commented Oct 5, 2016

Well for pnpm the best would be if ava would just work with --preserve-symlinks 😄

Is it somewhere documented why ava cannot do that?

@sindresorhus
Copy link
Member

I don't remember why. See: #814. @jamestalmage would be the best person to comment on this.

We're not going to add an option, but if there's any way we could automatically support it without too much code I'm open to it.

@novemberborn
Copy link
Member

I think #643 (comment) should fix this.

@zkochan
Copy link

zkochan commented Jan 10, 2017

I don't know whether this was fixed on ava's end but the latest version of pnpm does not require --preserve-symlinks. It is used by default for now, but you can set the preserve-symlinks config to false by running npm config set preserve-symlinks false and ava should work fine.

In case of questions feel free to open an issue on pnpm, or write me on gitter/twitter

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

No branches or pull requests

5 participants