Загрузка...

Скомпилировать в ехе вместе с html

Тема в разделе Node.js создана пользователем E11EVENTH 19 дек 2022. 250 просмотров

  1. E11EVENTH
    E11EVENTH Автор темы 19 дек 2022 22 31 дек 2018
    Как скомпилировать ноду в ехе вместе с html? Сервер запускает сайт, через node script.js работает, если скомпилировать pkg script.js то когда заходишь на сайт пишет что html не добавлен в exe
     
  2. cardholder
    cardholder 23 дек 2022 Заблокирован(а) 2448 13 июл 2022
    воспользуйся electron'ом
     
    1. Посмотреть предыдущие комментарии (5)
    2. cardholder
      E11EVENTH, я думаю проблема в самом компиляторе, потому что он просто не учитывает html
    3. E11EVENTH Автор темы
      cardholder, ну я в нём этого pkg полазил, там так, отдаленно намекают что и как, но прямого объяснения что и где прописать нету :/
  3. Мультичел
    Мультичел 25 дек 2022 Заблокирован(а) 10 533 18 авг 2022
    To compile a Node.js script into an EXE file, you can use a tool like pkg. pkg is a command-line tool that can be used to create standalone executables from Node.js scripts.

    Here is an example of how you can use pkg to compile a Node.js script into an EXE file:


    Install pkg by running the following command:

    Код
    npm install -g pkg
    Create a Node.js script that you want to compile into an EXE file.
    Compile the script into an EXE file using pkg. For example:

    Код
    pkg script.js
    This will create an EXE file called "script.exe" that includes the Node.js script. When you run the EXE file, it will execute the Node.js script.

    Note that pkg can only include static files like HTML, CSS, and JavaScript in the EXE file. If you need to include other types of files (e.g. images, audio, etc.), you will need to use a different approach. One option is to use a tool like electron-packager, which can package a Node.js app into a standalone executable that includes all necessary files.
     
    1. E11EVENTH Автор темы
      Мультичел, ну вот последний абзац, я понимаю что может быть добавлены статические файлы, но как?
Загрузка...
Top