Skip to content

Invalid or Unexpected Token #231

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
1 of 4 tasks
hacdias opened this issue Jan 12, 2018 · 4 comments
Closed
1 of 4 tasks

Invalid or Unexpected Token #231

hacdias opened this issue Jan 12, 2018 · 4 comments

Comments

@hacdias
Copy link

hacdias commented Jan 12, 2018

Run the command:

echo "hello" | ./node_modules/.bin/commitlint

Expected Behavior

Get the results.

Current Behavior

PS D:\Code\ipfs\aegir> 
D:\Code\ipfs\aegir\commitlint.config.js:1
(function (exports, require, module, __filename, __dirname) { ��m
                                                              ^

SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:152:10)
    at Module._compile (module.js:624:28)
    at requireFromString (D:\Code\ipfs\aegir\node_modules\require-from-string\index.js:28:4)
    at parseJsFile (D:\Code\ipfs\aegir\node_modules\cosmiconfig\dist\loadJs.js:15:15)
    at <anonymous>

Affected packages

  • cli
  • core
  • prompt
  • config-angular
@hacdias
Copy link
Author

hacdias commented Jan 12, 2018

Sorry. Windows line endings...

@escapedcat
Copy link
Member

Hey @hacdias could you elaborate your solution to this Windows line issue? Other users facing this issue as well and we're not too familiar with using this in a Windows environment. Thanks.

@hacdias
Copy link
Author

hacdias commented Apr 12, 2019

@escapedcat as far as I remember, the issue was with what I cloned. If you clone with certain line endings (CRLF), then Node wasn't able to read the files since they ended up with 'CRLF' instead of 'LF'. I'm not sure if that should be a bug anymore or if it is related at all with commitlint or Node.js itself.

Looking at the issue, that seems to have been the problem, but I'm not sure either. It was a long time ago. Sorry for that

Ref.: https://help.github.com/en/articles/dealing-with-line-endings

@sycIsAGod
Copy link

Change the file code to UTF-8

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

No branches or pull requests

3 participants