제품 업데이트
Tencent Cloud 오디오/비디오 단말 SDK 재생 업그레이드 및 권한 부여 인증 추가
TRTC 월간 구독 패키지 출시 관련 안내

$ npm config set electron_custom_dir 8.1.1 # 버전 번호에 따라 결정
Error:resource\\trtc_electron_sdk.node is not a valid Win32 application, 프롬프트에 32비트 trtc_electron_sdk.node가 필요하다는 오류가 보고됩니다.
npm run install -- arch=ia32
trtc_electron_sdk.node 다운로드 후, 프로젝트를 다시 패키징합니다.cd ~/Library/Application\\ Support/com.apple.TCC/cp TCC.db TCC.db.baksqlite3 TCC.db # sqlite> prompt appears.# for Mojave, CatalinaINSERT into access VALUES('kTCCServiceCamera',"com.microsoft.VSCode",0,1,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);# for BigSurINSERT into access VALUES('kTCCServiceCamera',"com.microsoft.VSCode",0,1,1,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);
“cannot read property 'dlopen' of undefined”?가 발생합니다.
let win = new BrowserWindow({width: 1366,height: 1024,minWidth: 800,minHeight: 600,webPreferences: {nodeIntegration: true,contextIsolation: false},});
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
npm config get cache를 실행하여 캐시 디렉터리를 조회합니다.npm install을 재실행합니다.csrutil disable을 입력하여 보호 메커니즘을 비활성화합니다.csrutil enable을 실행해야합니다.xx is not defined라는 메시지를 표시합니다. 여기서 xx는 node 모듈을 나타냅니다. 예:Uncaught ReferenceError: require is not defined
let win = new BrowserWindow({width: 1366,height: 1024,webPreferences: {nodeIntegration: true, // 이 항목을 true로 설정하십시오.},});
NodeRTCCloud is not a constructor
Cannot open xxx/trtc_electron_sdk.node 또는 The specified module could not be found
dlopen(xxx/trtc_electron_sdk.node, 1): image not found
native-ext-loader 설치.$ npm i native-ext-loader -D
module.exports 전, 코드 구축 과정에서 각각의 타깃 플랫폼 특징에 따라 정확하게 패키징할 수 있도록 webpack.config.js 구축 시 --target_platform의 명령 라인 매개변수를 수신하기 위해 다음 코드를 추가합니다.const os = require('os');// target_platform 매개변수를 전달하지 않으면 프로그램은 기본적으로 현재 플랫폼 유형에 따라 패키징됩니다.const targetPlatform = (function(){let target = os.platform();for (let i=0; i<process.argv.length; i++) {if (process.argv[i].includes('--target_platform=')) {target = process.argv[i].replace('--target_platform=', '');break;}}// win32는 32비트 및 64비트를 포함하여 Windows 플랫폼을 균일하게 나타냅니다. darwin은 Mac 플랫폼을 의미합니다.if (!['win32', 'darwin'].includes) target = os.platform();return target;})();
module: {rules: [{test: /\\.node$/,loader: 'native-ext-loader',options: {rewritePath: targetPlatform === 'win32' ? './resources' : '../Resources'}},]}
vue-cli를 사용하여 프로젝트를 생성한 경우 webpack 구성은 vue.config.js 파일의 configureWebpack 옵션에 저장됩니다.create-react-app을 사용하여 프로젝트를 생성한 경우, webpack 구성 파일은 [프로젝트 디렉터리]/node_modules/react-scripts/config/webpack.config.js입니다.electron-builder 패키지 구성 추가(대소문자 주의):"build": {"생략": "...","win": {"extraFiles": [{"from": "node_modules/trtc-electron-sdk/build/Release/","to": "./resources","filter": ["**/*"]}]},"mac": {"extraFiles": [{"from": "node_modules/trtc-electron-sdk/build/Release/trtc_electron_sdk.node","to": "./Resources"}]},"directories": {"output": "./bin"}},
create-react-app 스크립트를 빌드하고 패키징합니다. 다음 구성을 참고하십시오."scripts": {"build:mac": "react-scripts build --target_platform=darwin","build:win": "react-scripts build --target_platform=win32","compile:mac": "node_modules/.bin/electron-builder --mac","compile:win64": "node_modules/.bin/electron-builder --win --x64","pack:mac": "npm run build:mac && npm run compile:mac","pack:win64": "npm run build:win && npm run compile:win64"}
vue-cli 프로젝트의 경우 다음 구성을 참고하십시오."scripts": {"build:mac": "vue-cli-service build --target_platform=darwin","build:win": "vue-cli-service build --target_platform=win32","compile:mac": "node_modules/.bin/electron-builder --mac","compile:win64": "node_modules/.bin/electron-builder --win --x64","pack:mac": "npm run build:mac && npm run compile:mac","pack:win64": "npm run build:win && npm run compile:win64"}
create-react-app으로 생성된 프로젝트는 electron-builder로 패키징할 때 이 문제가 발생할 수 있습니다.$ node_modules\\.bin\\electron-builder.cmd• electron-builder version=22.6.0 os=6.1.7601• loaded configuration file=package.json ("build" field)• public/electron.js not found. Please see https://medium.com/@kitze/%EF%B8%8F-from-react-to-an-electron-app-ready-for-production-a0468ecb1da3• loaded parent configuration preset=react-cra
$ cd [프로젝트 디렉터리]$ mv main.electron.js ./public/electron.js
{"main": "public/electron.js","생략": "..."}
[프로젝트 디렉터리]\\node_modules\\electron-builder\\node_modules\\fs-extra\\lib\\empty\\index.js:33} catch {^SyntaxError: Unexpected token {at new Script (vm.js:51:7)
피드백