kentcdodds / webpack-validator-DEPRECATED

Use this to save yourself some time when working on a webpack configuration.
MIT License
93 stars 8 forks source link

Project setup not working for windows environments #7

Closed nyrosmith closed 8 years ago

nyrosmith commented 8 years ago

I have setup the project according to the Contributing guideline No matter which npm script I run I get errors. npm run validate generates the following npm-debug.log:

npm-debug.log.txt

I really have no idea how to fix this. Sorry for the inconvenience :-(

kentcdodds commented 8 years ago

Hi @nyrosmith! This is exactly why we have the validate script! Let's figure out what's going on. The validate script runs the following npm scripts:

Could you run each of these independently and tell me which one(s) are failing? The log you sent is unfortunately not telling me much :-)

nyrosmith commented 8 years ago

Sure! test_config.log.txt check-coverage.log.txt cover.log.txt lint.log.txt

Linting works if I modify it to: node_modules/.bin/eslint .

Do I have to install some modules globally?

kentcdodds commented 8 years ago

Hmmm... You shouldn't have to. What version of node/npm are you using? Could you try updating the latest versions of both and try again?

nyrosmith commented 8 years ago

Ok, I updated node & npm and deleted and reinstalled the node_modules. Win7 64 bit node: 5.7.0 npm: 3.7.3

Same behavior as before :-( This is really annoying. My first attempt to contribute and I fail on the setup...

kentcdodds commented 8 years ago

Hmmm... I'm still not sure what's going on here. Do you think you could run those with the flag -s?

This will make npm be quiet so the output is specifically the script output. Then copy/paste the output you see in here.

Thanks for working with me on this!

nyrosmith commented 8 years ago

Will do it tomorrow, now it's reactConf time. But with a little research I found the following: I have CRLF line endings -> lint exits not with non zero code npm-run-all kills the other tasks npm-run-all

Note: If a task exited with non zero code, the other tasks and those descendant processes are killed with SIGTERM (On Windows, with taskkill.exe /F /T).

Wil do more investigation tomorrow

nyrosmith commented 8 years ago

npm run lint works now after changing line endings to LF. npm run cover -s: cover.log.txt cover doesnot find files to test and ends with non zero exit code 'npm run build' works 'npm run test:configs' works npm run check-coverage -s ERROR: No coverage files found

nyrosmith commented 8 years ago

Current status: I got it somehow working but it feels really nasty.

I am really not sure how to proceed. Maybe I should install Linux but on the other side I think it should be possible to contribute without all this pitfalls.

I have my current package.json attached because maybe someone more experienced than me can help out and find a solution that works on Mac & Windows. And maybe all I did was just stupid and I missed something essential...

package.json.txt

kentcdodds commented 8 years ago

Yeah, we definitely want this to work seamlessly across platforms.

Unfortunately until we get this worked out, when you commit in this project, you'll have to skip the githook by using --no-verify.

nyrosmith commented 8 years ago

And I am not allowed to commit the package.json

kentcdodds commented 8 years ago

Do you mean you can't push to this repo? It's because you don't have access to it. You'll need to fork the repo.

If that's not what you meant, I'm not sure what you mean.

nyrosmith commented 8 years ago

I forked it and pushed my package.json & .gitattributes to my master. When I now create a feature branch and send you a pull request then the PR also contains my package.json which might break setup in your machine. Or am I wrong?

BarryThePenguin commented 8 years ago

For line endings on Windows I'd recommend using git config --global core.autocrlf input

Then in .gitattributes have

* text=auto

Modern editors in Windows support LF line endings. I'm not aware of a reason to use CRLF

nyrosmith commented 8 years ago

This changes are not working for me. Every npm script with npm-run-all fails

kentcdodds commented 8 years ago

Hmmm... I honestly think that it's an issue with your setup. AFAIK, it's working fine for @BarryThePenguin and @mikekidder right?

nyrosmith commented 8 years ago

I'd love to give access to my machine via TeamViewer or similar tool bc. I really don't think I have anything specific setup

kentcdodds commented 8 years ago

Are you getting the same errors you were before? Are you sure you've updated your fork with master? Could you double check that please? Thanks for your patience!

nyrosmith commented 8 years ago

I am getting exact the same behavior as before. I deleted my fork and forked again. I also deleted the repo on my HDD and cloned the fork. I really don't know why I have problems which no one other has..

RReverser commented 8 years ago

@kentcdodds You probably want to use text eol=lf instead if tests/tools rely on specific line ending.

kentcdodds commented 8 years ago

Thanks @RReverser! I was going to remove the ESLint rules on line endings, but then I opened up a file in vim with different line endings and it was a nightmare. Maybe I should fix my tool, but I've just never really had this problem in any other project before :-/

BarryThePenguin commented 8 years ago

I've opened an issue on npm-run-all after investigating this issue. My issue may not be related to this, but I'm not able to run validate either...

kentcdodds commented 8 years ago

Thanks for the feedback! I was under the impression that npm-run-all was supposed to work cross-platform and that was part of my motivation for using the tool. I've looked at the issue you filed and it looks like some fixes may be coming soon :tada: Thank you for putting that time in!

Are there any other commands not working for you? Each script should run on all platforms and if they don't that's a bug and should be resolved.

BarryThePenguin commented 8 years ago

All the other scripts run, other than cover. It complains about not being able to find any coverage.

$ npm run validate

> webpack-validator@1.0.0-beta.6 validate C:\Projects\personal\webpack-validator
> npm-run-all --parallel lint cover build test:configs --sequential check-coverage

ERROR: cover: None-Zero Exit(1);
kentcdodds commented 8 years ago

Hmmm, that would insinuate that the npm run cover command is not outputting any files :-(

nyrosmith commented 8 years ago

Shall we remove npm-run-all until the fix has landed? Would ease contributing until this works cross-platform

kentcdodds commented 8 years ago

:+1: Definitely willing to accept using && instead. I'll make a PR that you can pull down and validate. Give me a second...