Skip to content

npm run grunt fails at eslint-samples:source with "prefixLength of undefined". #3692

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

Closed
JoshuaGrams opened this issue Apr 10, 2019 · 5 comments

Comments

@JoshuaGrams
Copy link

  • p5.js commit e838315
  • Windows 10 version 1803 (OS Build 17134.706)
  • Nodej.s 10.15.3
  • npm 6.4.1

I cloned the repository from github, did npm install, then npm run grunt. It fails at eslint-samples:source (npm run grunt eslint-samples:source gets the same error faster) with "Warning: Cannot read property 'prefixLength' of undefined Use --force to continue."

Then it says "Aborted due to warnings." and the stacktrace is from node_modules/npm-lifecycle/index.js which doesn't look helpful.

I did find this comment #3387 (comment) and the following one, which suggests that it's a line-endings thing. But I checked and there are no CRLFs in the src/ or lib/ directories, and adding them produced many errors wanting the CRs removed.

Any suggestions?

@welcome
Copy link

welcome bot commented Apr 10, 2019

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@stalgiag
Copy link
Contributor

Hi @JoshuaGrams how did you clone the repository? This definitely seems like a line-endings problem. I develop on Windows as well. I'd also check to see what value you have for core.autocrlf with git config --list

@JoshuaGrams
Copy link
Author

I have core.autocrlf set to false, and there are no DOS line endings in the project. I tried switching to DOS line endings and it just gave errors about wanting to remove the '\r' characters...

@JoshuaGrams
Copy link
Author

Oh, huh. I switched it to DOS line endings again and now the build works. I wonder what I did wrong the other two times I tried it?

Well, thanks for your time.

@fal-works
Copy link
Contributor

For anyone who reached here:
I just had the same issue, and after doing the below eslint-samples:source succeeded.

  1. Set autocrlf so that the line endings will be automatically converted: git config --local core.autocrlf true
  2. Remove all files except .git and restore them again by git restore .

Had then another error in the succeeding test task, but anyway :)

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

No branches or pull requests

3 participants