メインコンテンツへスキップ
見出し画像

Deskreenを無料で使いたくて、Community EditionをMacでビルドした

    Deskreenについて

    Wi-Fi経由であらゆるデバイスをパソコンのセカンドスクリーン(外部モニター)にできるDeskreenというアプリケーションがある。

    調べると無料で利用できると出てくるのだが、利用したくて公式サイトにアクセスしたところダウンロードにあたり有料版を契約するように促される。

    ソースコードはgithub上に公開されているので、DeskreenのCommunity Editionをbuildして利用できるようにしたので、手順を載せる

    miseでnodeをインストール

    Deskreenをbuildするにあたりnodeをインストールする必要がある。
    github上のREADMEにはnode23以上、npm10以上とある。

    You will need to have `node>=v23` `npm>=10` installed.

    https://github.com/pavlobu/deskreen/blob/b5dc3d4d1a74ec38091d36578fd84174db3792bc/README.md?plain=1#L29

    今のnodeのLTSはv24.19.0なので、まずはv24.19.0で試すが上手くいかなかった時にv23系でも実行したい。
    今回はmiseでnodeを切り替えれるようにする。

    #miseをインストール
    sudo port install mise
    
    #zsh起動時にmiseをactivateする(miseでグローバルにインストールしたコマンドが利用できるようになる
    echo 'eval "$(mise activate zsh)"' >> ~/.zshrc
    
    #zshをリロード
    exec $SHELL -l
    
    #nodeの24系を利用
    mise use -g node@24

    package.jsonを見るとnpmは10.9.0を想定しているようだが、これはnpmのサプライチェーン対策が施されていないnpmバージョンなのでnode24系のデフォルトnpmを利用することをお勧めする。

    "packageManager": "npm@10.9.0"

    https://github.com/pavlobu/deskreen/blob/master/package.json#L106
    #npmの10.9.0を利用する際は自己責任で(このバージョンだとコマンド数が少なくbuildできるが非推奨)
    mise use -g npm@10.9.0

    deskreenをbuild

    deskreenをclone

    git clone https://github.com/pavlobu/deskreen.git

    deskreen直下でコマンドを実行

    npm installを実行

    npm install

    出力結果

    % npm install
    npm warn deprecated @types/socket.io@3.0.2: This is a stub types definition. socket.io provides its own type definitions, so you do not need this installed.
    npm warn deprecated @types/socket.io-client@3.0.0: This is a stub types definition. socket.io-client provides its own type definitions, so you do not need this installed.
    npm warn deprecated @types/qrcode.react@3.0.0: This is a stub types definition. qrcode.react provides its own type definitions, so you do not need this installed.
    npm warn deprecated @types/react-toast-notifications@2.4.1: This is a stub types definition. react-toast-notifications provides its own type definitions, so you do not need this installed.
    npm warn deprecated @types/electron-devtools-installer@4.0.0: This is a stub types definition. electron-devtools-installer provides its own type definitions, so you do not need this installed.
    npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
    npm warn deprecated lodash.isequal@4.5.0: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
    npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
    npm warn deprecated koa-router@14.0.0: Please use @koa/router instead, starting from v9! 
    npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
    npm warn deprecated fontsource-lexend-peta@4.0.0: Package relocated. Please install and migrate to @fontsource/lexend-peta.
    npm warn deprecated boolean@3.2.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
    npm warn deprecated @material-ui/styles@4.11.5: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.
    npm warn deprecated @material-ui/core@4.12.4: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.
    
    > deskreen-ce@3.2.16 postinstall
    > electron-builder install-app-deps
    
      • electron-builder  version=26.8.1
      • loaded configuration  file=~/dev/deskreen/electron-builder.yml
      • executing @electron/rebuild  electronVersion=37.10.3 arch=arm64 buildFromSource=false workspaceRoot=~/dev/deskreen projectDir=./ appDir=./
      • installing native dependencies  arch=arm64
      • completed installing native dependencies
    
    added 651 packages, and audited 652 packages in 7s
    
    93 packages are looking for funding
      run `npm fund` for details
    
    30 vulnerabilities (1 low, 3 moderate, 22 high, 4 critical)
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.
    npm warn install-scripts 3 packages have install scripts not yet covered by allowScripts:
    npm warn install-scripts   electron@37.10.3 (postinstall: node install.js)
    npm warn install-scripts   esbuild@0.25.12 (postinstall: node install.js)
    npm warn install-scripts   fsevents@2.3.3 (install: (install scripts present))
    npm warn install-scripts
    npm warn install-scripts Run `npm install-scripts ls` to review, or `npm install-scripts approve <pkg>` to allow.

    npmのサプライチェーン対策のためpostinstallが実行されないようになっている。許可ポリシーに含まれていないパッケージの一覧を確認します。

    npm approve-scripts --allow-scripts-pending

    出力結果

    % npm approve-scripts --allow-scripts-pending
    3 packages have install scripts not yet covered by allowScripts:
      electron@37.10.3 (postinstall: node install.js)
      esbuild@0.25.12 (postinstall: node install.js)
      fsevents@2.3.3 (install: (install scripts present))
    
    Run `npm install-scripts approve <pkg>` to allow, or `npm install-scripts deny <pkg>` to deny.

    各パッケージを個別に許可を与える

    npm approve-scripts electron
    npm approve-scripts esbuild
    npm approve-scripts fsevents

    出力結果

    % npm approve-scripts electron
    Approved electron:
    added electron@37.10.3
    % npm approve-scripts esbuild
    Approved esbuild:
    added esbuild@0.25.12
    % npm approve-scripts fsevents
    Approved fsevents:
    added fsevents@2.3.3

    再度 npm install

    npm install
    % npm install
    
    > deskreen-ce@3.2.16 postinstall
    > electron-builder install-app-deps
    
      • electron-builder  version=26.8.1
      • loaded configuration  file=~/dev/deskreen/electron-builder.yml
      • executing @electron/rebuild  electronVersion=37.10.3 arch=arm64 buildFromSource=false workspaceRoot=~/dev/deskreen projectDir=./ appDir=./
      • installing native dependencies  arch=arm64
      • completed installing native dependencies
    
    up to date, audited 652 packages in 3s
    
    93 packages are looking for funding
      run `npm fund` for details
    
    30 vulnerabilities (1 low, 3 moderate, 22 high, 4 critical)
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.

    client-viewでも同じことをする

    cd ./src/client-viewer ; npm i; npm approve-scripts core-js; npm approve-scripts esbuild; npm approve-scripts fsevents; npm i; cd ../../

    出力結果

    deskreen % cd ./src/client-viewer             
    client-viewer % npm i
    npm warn deprecated @types/socket.io-client@3.0.0: This is a stub types definition. socket.io-client provides its own type definitions, so you do not need this installed.
    
    added 472 packages, and audited 473 packages in 5s
    
    75 packages are looking for funding
      run `npm fund` for details
    
    15 vulnerabilities (7 low, 3 moderate, 5 high)
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.
    npm warn install-scripts 3 packages have install scripts not yet covered by allowScripts:
    npm warn install-scripts   core-js@3.49.0 (postinstall: node -e "try{require('./postinstall')}catch(e){}")
    npm warn install-scripts   esbuild@0.25.12 (postinstall: node install.js)
    npm warn install-scripts   fsevents@2.3.3 (install: (install scripts present))
    npm warn install-scripts
    npm warn install-scripts Run `npm install-scripts ls` to review, or `npm install-scripts approve <pkg>` to allow.
    client-viewer % npm approve-scripts --allow-scripts-pending
    3 packages have install scripts not yet covered by allowScripts:
      core-js@3.49.0 (postinstall: node -e "try{require('./postinstall')}catch(e){}")
      esbuild@0.25.12 (postinstall: node install.js)
      fsevents@2.3.3 (install: (install scripts present))
    
    Run `npm install-scripts approve <pkg>` to allow, or `npm install-scripts deny <pkg>` to deny.
    client-viewer % npm approve-scripts core-js                
    npm approve-scripts esbuild
    npm approve-scripts fsevents
    Approved core-js:
      added core-js@3.49.0
    Approved esbuild:
      added esbuild@0.25.12
    Approved fsevents:
      added fsevents@2.3.3
    % npm i                                      
    
    up to date, audited 473 packages in 1s
    
    75 packages are looking for funding
      run `npm fund` for details
    
    15 vulnerabilities (7 low, 3 moderate, 5 high)
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.

    ビルドを実行

    cd ../../
    npm run clean && npm run build:mac:arm64

    出力結果

    deskreen % npm run clean && npm run build:mac:arm64
    
    > deskreen-ce@3.2.16 clean
    > rm -rf dist out src/client-viewer/dist
    
    
    > deskreen-ce@3.2.16 build:mac:arm64
    > npm run buildClientViewer && electron-vite build && electron-builder --mac --arm64
    
    
    > deskreen-ce@3.2.16 buildClientViewer
    > cd src/client-viewer && npm run build
    
    
    > deskreen-ce-client-viewer@3.2.16 build
    > tsc -b && vite build
    
    vite v7.2.4 building client environment for production...
    (!) %VITE_CLIENT_VIEWER_GA_TAG% is not defined in env variables found in /index.html. Is the variable mistyped?
    (!) %VITE_CLIENT_VIEWER_VERSION% is not defined in env variables found in /index.html. Is the variable mistyped?
    (!) %VITE_CLIENT_VIEWER_GA_TAG% is not defined in env variables found in /index.html. Is the variable mistyped?
    (!) %VITE_CLIENT_VIEWER_GA_TAG% is not defined in env variables found in /index.html. Is the variable mistyped? (x2)
    ✓ 2752 modules transformed.
    dist/assets/allPathsLoader-legacy-CD5buS9O.js              0.32 kB │ gzip:   0.23 kB
    dist/assets/allPaths-legacy-BKtMD0Vi.js                    0.35 kB │ gzip:   0.25 kB
    dist/assets/splitPathsBySizeLoader-legacy-BUmDDD9a.js      0.38 kB │ gzip:   0.27 kB
    dist/assets/browser-ponyfill-legacy-DFUY-3Yv.js           10.79 kB │ gzip:   3.78 kB
    dist/assets/polyfills-legacy-B0PQXrj7.js                  65.64 kB │ gzip:  24.02 kB
    dist/assets/index-legacy-C6RgR_H8.js                     286.10 kB │ gzip:  96.12 kB
    dist/assets/index-legacy-9Z95Qi2p.js                     295.27 kB │ gzip:  98.60 kB
    dist/assets/index-legacy-DHFAinOS.js                   1,880.70 kB │ gzip: 473.68 kB
    
    (!) Some chunks are larger than 500 kB after minification. Consider:
    - Using dynamic import() to code-split the application
    - Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
    - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
    dist/index.html                                    11.45 kB │ gzip:   2.87 kB
    dist/assets/deskreen_logo_128x128-ndVS49i5.png     27.56 kB
    dist/assets/index-D0OlWkdi.css                    524.68 kB │ gzip:  63.11 kB
    dist/assets/allPaths-BxqeM6Kd.js                    0.26 kB │ gzip:   0.19 kB
    dist/assets/splitPathsBySizeLoader-CT-keIz7.js      0.28 kB │ gzip:   0.22 kB
    dist/assets/allPathsLoader-DOTlLIS8.js              0.48 kB │ gzip:   0.28 kB
    dist/assets/browser-ponyfill-B82p_3mQ.js           11.04 kB │ gzip:   3.84 kB
    dist/assets/index-DtzT8OsX.js                     290.16 kB │ gzip:  97.85 kB
    dist/assets/index-mbPvlb_I.js                     299.32 kB │ gzip: 100.41 kB
    dist/assets/index-CR1eAEEx.js                   1,393.79 kB │ gzip: 427.26 kB
    
    (!) Some chunks are larger than 500 kB after minification. Consider:
    - Using dynamic import() to code-split the application
    - Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
    - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
    ✓ built in 8.23s
    vite v7.2.4 building ssr environment for production...
    ✓ 53 modules transformed.
    Entry module "src/main/index.ts" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
    out/main/bytecode-loader.cjs    2.31 kB
    out/main/index.js             264.21 kB
    ✓ built in 1.56s
    ✓ 1 bundles compiled into bytecode.
    out/main/index.jsc   273.58 kB
    vite v7.2.4 building ssr environment for production...
    ✓ 1 modules transformed.
    out/preload/bytecode-loader.cjs  2.31 kB
    out/preload/helperRenderer.js    0.12 kB
    out/preload/index.js             0.78 kB
    ✓ built in 66ms
    ✓ 2 bundles compiled into bytecode.
    out/preload/index.jsc            1.03 kB
    out/preload/helperRenderer.jsc   0.59 kB
    vite v7.2.4 building client environment for production...
    <script src="./assets/simplepeer.min.js"> in "/peerConnectionHelperRendererWindowIndex.html" can't be bundled without type="module" attribute
    ✓ 3063 modules transformed.
    Attempting to copy static files from: ~/dev/deskreen/src/client-viewer/dist
    To destination: ~/dev/deskreen/out/client-viewer
    Attempting to copy simple-peer.min.js from: ~/dev/deskreen/node_modules/simple-peer/simplepeer.min.js
    To destination: ~/dev/deskreen/out/renderer/assets
    ../../out/renderer/index.html                                                  0.70 kB
    ../../out/renderer/peerConnectionHelperRendererWindowIndex.html                0.76 kB
    ../../out/renderer/assets/lexend-peta-latin-ext-400-normal-DJ3XbbOh.woff2     11.69 kB
    ../../out/renderer/assets/lexend-peta-latin-400-normal-BFGlA6Sc.woff2         12.66 kB
    ../../out/renderer/assets/fa-regular-400-nyy7hhHF.woff2                       18.92 kB
    ../../out/renderer/assets/lexend-peta-all-400-normal-DKadjEXF.woff            33.83 kB
    ../../out/renderer/assets/logo192-BSZgJquf.png                                38.54 kB
    ../../out/renderer/assets/fa-brands-400-BP5tdqmh.woff2                       110.09 kB
    ../../out/renderer/assets/fa-solid-900-DRAAbZTg.woff2                        114.74 kB
    ../../out/renderer/assets/index-DdkJDpI8.css                                 738.30 kB
    ../../out/renderer/assets/allPaths-DYObqVLq.js                                 0.44 kB
    ../../out/renderer/assets/splitPathsBySizeLoader-Upj6wtnA.js                   0.76 kB
    ../../out/renderer/assets/allPathsLoader-CKPa6ZTe.js                           0.76 kB
    ../../out/renderer/assets/IpcEvents.enum-k4_DU7S8.js                           5.45 kB
    ../../out/renderer/assets/helperRenderer-DqoP6v1Y.js                         110.65 kB
    ../../out/renderer/assets/index-CLhoPfmf.js                                  310.28 kB
    ../../out/renderer/assets/index-Knlp9z4G.js                                  319.44 kB
    ../../out/renderer/assets/index-Bv2K0N8Z.js                                1,508.71 kB
    Successfully copied simple-peer.min.js to out/client-viewer/static/js
    Successfully copied client-viewer/dist to out/client-viewer
    ✓ built in 1.38s
      • electron-builder  version=26.8.1 os=25.5.0
      • loaded configuration  file=~/dev/deskreen/electron-builder.yml
      • writing effective config  file=dist/builder-effective-config.yaml
      • skipped dependencies rebuild  reason=npmRebuild is set to false
      • packaging       platform=darwin arch=arm64 electron=37.10.3 appOutDir=dist/mac-arm64
      • searching for node modules  pm=npm searchDir=~/dev/deskreen
    (node:39023) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
    (Use `node --trace-deprecation ...` to show where the warning was created)
      • collector stderr output  dependencies=["npm error code ELSPROBLEMS\nnpm error invalid: @types/react@19.2.14 ~/dev/deskreen/node_modules/@types/react\nnpm error invalid: react-dom@19.2.5 ~/dev/deskreen/node_modules/react-dom\nnpm error invalid: react@19.2.5 ~/dev/deskreen/node_modules/react\nnpm error A complete log of this run can be found in: ~/.npm/_logs/2026-08-08T02_49_27_826Z-debug-0.log\n"]
      • duplicate dependency references  dependencies=["@types/react@19.2.14","pascal-case@3.1.2","no-case@3.0.4","no-case@3.0.4","no-case@3.0.4","capital-case@1.0.4","dot-case@3.0.4","no-case@3.0.4","dot-case@3.0.4","no-case@3.0.4","upper-case-first@2.0.2","dot-case@3.0.4","react-dom@19.2.5","react-dom@19.2.5","react-dom@19.2.5","react-dom@19.2.5","loose-envify@1.4.0","prop-types@15.8.1","react-dom@19.2.5","@blueprintjs/colors@5.1.16","@blueprintjs/core@6.12.1","@blueprintjs/icons@6.9.1","@types/react@19.2.14","react-dom@19.2.5","debug@4.4.3","@types/node@25.6.0","@types/node@25.6.0","@types/responselike@1.0.3","@types/node@25.6.0","get-stream@5.2.0","responselike@2.0.1","debug@4.4.3","@types/node@25.6.0","debug@4.4.3","once@1.4.0","electron@37.10.3","@material-ui/utils@4.11.3","@types/react@19.2.14","hoist-non-react-statics@3.3.2","jss@10.10.0","jss@10.10.0","jss@10.10.0","jss@10.10.0","jss@10.10.0","jss@10.10.0","jss@10.10.0","prop-types@15.8.1","react-dom@19.2.5","@material-ui/utils@4.11.3","@types/react@19.2.14","prop-types@15.8.1","react-dom@19.2.5","@types/react@19.2.14","prop-types@15.8.1","react-dom@19.2.5","@types/react@19.2.14","@types/react@19.2.14","loose-envify@1.4.0","react-dom@19.2.5","react-transition-group@4.4.5","call-bind-apply-helpers@1.0.2","es-object-atoms@1.1.1","hasown@2.0.3","hasown@2.0.3","electron@37.10.3","debug@4.4.3","jsonfile@6.2.1","debug@4.4.3","koa-send@5.0.1","mime-types@2.1.35","http-errors@2.0.1","prop-types@15.8.1","@emotion/serialize@0.11.16","@babel/parser@7.29.3","@babel/types@7.29.0","@jridgewell/trace-mapping@0.3.31","@babel/types@7.29.0","@babel/code-frame@7.29.0","@babel/parser@7.29.3","@babel/types@7.29.0","@babel/types@7.29.0","debug@4.4.3","@emotion/serialize@0.11.16","@babel/code-frame@7.29.0","hasown@2.0.3","react-dom@19.2.5","react-transition-group@4.4.5","debug@4.4.3","debug@4.4.3","debug@4.4.3","debug@4.4.3","accepts@1.3.8","debug@4.4.3","@types/node@25.6.0","@types/node@25.6.0","accepts@1.3.8","cors@2.8.6","debug@4.4.3","debug@4.4.3","socket.io-parser@4.2.6"]
      • falling back to ad-hoc signature for macOS application code signing
      • signing         file=dist/mac-arm64/Deskreen CE.app platform=darwin type=distribution identityName=- identityHash=none provisioningProfile=none
      • skipped macOS notarization  reason=`notarize` options were set explicitly `false`
      • building        target=macOS zip arch=arm64 file=dist/deskreen-ce-3.2.16-arm64.zip
      • building        target=DMG arch=arm64 file=dist/deskreen-ce-3.2.16-arm64.dmg
      • building block map  blockMapFile=dist/deskreen-ce-3.2.16-arm64.dmg.blockmap
      • building block map  blockMapFile=dist/deskreen-ce-3.2.16-arm64.zip.blockmap
    deskreen % 

    アプリケーションを実行

    dist以下にdeskreen-ce-3.2.16-arm64.dmgができているのでそれをダブルクリック。

    画像
    dmgをダブルクリックした様子

    Applicationsフォルダに移動して実行。

     
     
    10年以上フリーランスとしてWeb開発に携わるエンジニア。生成AI、ローカルLLMなど、自分の興味ある事で実際に試して分かったことや技術的な問題の解決方法を記録していきます。

    あなたへのおすすめ