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

errors when building with gulp #73

Open
blackjack-uic opened this issue Jan 7, 2022 · 3 comments
Open

errors when building with gulp #73

blackjack-uic opened this issue Jan 7, 2022 · 3 comments

Comments

@blackjack-uic
Copy link

Hi,
I encountered an error when trying to build with gulp. I ran the first two npm commands and it worked fine. The error look like this:

PS C:\tools\LiteMol-2> gulp
[20:45:52] Requiring external module ts-node/register
{ TSError: ⨯ Unable to compile TypeScript
gulpfile.ts (163,46): Argument of type '"UTF-8"' is not assignable to parameter of type '"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "...'. (2345)
gulpfile.ts (164,59): Argument of type '"UTF-8"' is not assignable to parameter of type '"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "...'. (2345)
gulpfile.ts (166,69): Argument of type '{ encoding: "UTF-8"; }' is not assignable to parameter of type 'WriteFileOptions'.
  Type '{ encoding: "UTF-8"; }' is not assignable to type 'ObjectEncodingOptions & Abortable & { mode?: string | number; flag?: string; }'.
    Type '{ encoding: "UTF-8"; }' is not assignable to type 'ObjectEncodingOptions'.
      Types of property 'encoding' are incompatible.
        Type '"UTF-8"' is not assignable to type 'BufferEncoding'. (2345)
gulpfile.ts (168,47): Argument of type '"UTF-8"' is not assignable to parameter of type '"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "...'. (2345)
gulpfile.ts (172,43): Argument of type '{ encoding: "UTF-8"; }' is not assignable to parameter of type 'WriteFileOptions'.
  Type '{ encoding: "UTF-8"; }' is not assignable to type 'ObjectEncodingOptions & Abortable & { mode?: string | number; flag?: string; }'.
    Type '{ encoding: "UTF-8"; }' is not assignable to type 'ObjectEncodingOptions'.
      Types of property 'encoding' are incompatible.
        Type '"UTF-8"' is not assignable to type 'BufferEncoding'. (2345)
    at getOutput (C:\tools\LiteMol-2\node_modules\ts-node\src\index.ts:307:15)
    at C:\tools\LiteMol-2\node_modules\ts-node\src\index.ts:336:16
    at Object.compile (C:\tools\LiteMol-2\node_modules\ts-node\src\index.ts:496:11)
    at Module.m._compile (C:\tools\LiteMol-2\node_modules\ts-node\src\index.ts:392:43)
    at Module._extensions..js (module.js:664:10)
    at Object.require.extensions.(anonymous function) [as .ts] (C:\tools\LiteMol-2\node_modules\ts-node\src\index.ts:395:12)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
  diagnostics:
   [ { message: 'gulpfile.ts (163,46): Argument of type \'"UTF-8"\' is not assignable to parameter of type \'"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "...\'. (2345)',
       code: 2345 },
     { message: 'gulpfile.ts (164,59): Argument of type \'"UTF-8"\' is not assignable to parameter of type \'"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "...\'. (2345)',
       code: 2345 },
     { message: 'gulpfile.ts (166,69): Argument of type \'{ encoding: "UTF-8"; }\' is not assignable to parameter of type \'WriteFileOptions\'.\n  Type \'{ encoding: "UTF-8"; }\' is not assignable to type \'ObjectEncodingOptions & Abortable & { mode?: string | number; flag?: string; }\'.\n    Type \'{ encoding: "UTF-8"; }\' is not assignable to type \'ObjectEncodingOptions\'.\n      Types of property \'encoding\' are incompatible.\n        Type \'"UTF-8"\' is not assignable to type \'BufferEncoding\'. (2345)',
       code: 2345 },
     { message: 'gulpfile.ts (168,47): Argument of type \'"UTF-8"\' is not assignable to parameter of type \'"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "...\'. (2345)',
       code: 2345 },
     { message: 'gulpfile.ts (172,43): Argument of type \'{ encoding: "UTF-8"; }\' is not assignable to parameter of type \'WriteFileOptions\'.\n  Type \'{ encoding: "UTF-8"; }\' is not assignable to type \'ObjectEncodingOptions & Abortable & { mode?: string | number; flag?: string; }\'.\n    Type \'{ encoding: "UTF-8"; }\' is not assignable to type \'ObjectEncodingOptions\'.\n      Types of property \'encoding\' are incompatible.\n        Type \'"UTF-8"\' is not assignable to type \'BufferEncoding\'. (2345)',
       code: 2345 } ] }

It looks like there is an encoding problem? I would much appreciate if anyone could help!

@dsehnal
Copy link
Owner

dsehnal commented Jan 7, 2022

Hi, this will likely be caused by NodeJS version. Would using https://molstar.org be an option for you?

@blackjack6666
Copy link

OK, that would be an option. I'll look into it, thx! Would integrating molstar be similar as litemol?

@dsehnal
Copy link
Owner

dsehnal commented Jan 9, 2022

Yes, it's quite similar.

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