[Electron] Electron-Builder (Error output: Bad text encoding: <stdin>:1 Error in script "<stdin>" on line 1 -- aborting creation process ) 오류

Gomi·2022년 2월 9일
0

😵 문제 상황


 Electron-Builder를 통해 프로젝트 빌드 중

Error output: Bad text encoding: :1 Error in script "" on line 1 -- aborting creation process

다음과 같은 에러 발생.
서칭 결과 빌드에서 사용한 코드의 텍스트 인코딩에서 문제가 발생하면 저런 에러가 발생.




🔑 해결

node_moduls/app-builder-lib/out/targets/nsis/NsisTarget.js

다음 경로 상 파일의 executeMakensis 함수에 UTF8 옵션을 추가하면 빌드가 되더라

    async executeMakensis(defines, commands, script) {
      const args = this.options.warningsAsErrors === false ? [] : ["-WX"];
      //추가 
	  args.push("-INPUTCHARSET", "UTF8", "-OUTPUTCHARSET", "UTF8");
      
      for (const name of Object.keys(defines)) {
          const value = defines[name];
          if (value == null) {
              args.push(`-D${name}`);
          }
          else {
              args.push(`-D${name}=${value}`);
          }
      }
profile
터키어 배운 롤 덕후

0개의 댓글