Open vitalets opened 7 years ago
Hmm i agree that it would be great, but install-local uses npm pack
and npm install
underneath. This has the benefit of not having to rebuild an actual installation, it just uses an actual npm install.
I guess we could create a fake package.json, do the install and remove it later. It seems kind of hacky, would you like such a solution?
Yes, creating fake package.json automatically would be great!
I'm happy to accept a PR for this.
@nicojs could you please point the place in the code where you think it's better to implement?
Ow sorry, seems it took me 2,5 years to respond 😅
If you're still interested, I think you're looking for src/currentDirectoryInstall.ts
. There we call readPackageJson
. I think we can detect the absence of a package.json
there and do something different than we're doing now..
Ow sorry, seems it took me 2,5 years to respond 😅
Never mind! I'm following your awesome work on stryker ;)
Concerning this question - I think generating dummy package,json
manually is ok as nobody except me came to this issue for 2.5 years.
Hmm, interesting. Well, that would be a breaking change, since now npm
will just walk up until it finds the first package.json
and install there. Maybe we should add this behind a --current-directory
flag or something?
Hmm, interesting. Well, that would be a breaking change, since now
npm
will just walk up until it finds the firstpackage.json
and install there. Maybe we should add this behind a--current-directory
flag or something?
Currently I'm fine with generating fake package.json
manually. I think we should not add more flags/behavior to install-local
until strong community request :)
Hi! Thank you for this library! I'm using it for testing the package I'm developing. Actually I test that it can be correctly installed. I have script that creates temporary directory, installs there from src and runs tests. Currently I need to create dummy
package.json
because otherwise I'm getting error. Steps:If I don't generate
package.json
I'm getting the error:It would be great to add option to not check
package.json
presence.