Advertisement

Node.js打包成可执行文件

阅读量:

软件包安装流程

复制代码
    npm install -g pkg
    
    
      
    

pkg命令功能解析

复制代码
    pkg --help
    
    
      
    

package.json配置优化

新增bin启动项配置

复制代码
    {
      "name": "takescreenshot",
      "version": "1.0.0",
      "bin": "app.js",   // 新增bin入口配置
      "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "description": "",
      "dependencies": {
    "express": "^4.21.1",
      }
    }
    
    
    
      
      
      
      
      
      
      
      
      
      

全部评论 (0)

还没有任何评论哟~