Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

The process error after using pkg to package nodejs project. #508

@Bruce-zxy

Description

@Bruce-zxy

Windows version: Windows 7 Service Pack 1
Command Interface: Windows Powershell
Nodejs version: v8.9.4
Pkg version: v4.3.4
Qiniu version: v7.1.7

Error Screenshot:
image
Error Position: package path -> "qiniu/index.js"
image

Error Repetition:
1.Save the following nodejs code as "server.js":

const express = require('express');
const qiniu = require('qiniu');
const app = express();
app.use('/', (req, res, next) => res.send('Hello World!') && next());
var server = app.listen(8081, function() {
var host = server.address().address
var port = server.address().port
console.log("Server start successfully on http://${host}:${port}")
})

2.Install dependencies:
npm install express qiniu --save

3.Start the service and check for success:
node server

4.Execute following command to package the project in powershell after successful startup:
npx pkg -t win server.js
or
npm install -g pkg
pkg -t win server.js

5.Execute .exe file:
.\server.exe

6.And that's where the problems come back.

Git Repo:
You can also clone the git repository that I have created. There are two branches in it. The master branch contains the incorrect project , the correct branch is the correct project. Execute the following commands in turn after cloning:
npm install
node server
npm install -g pkg
pkg -t win server.js
.\server.exe

url:https://github.com/Bruce-zxy/pgk-qiniu-error
git:https://github.com/Bruce-zxy/pgk-qiniu-error.git

In addition, I mentioned issue#307 at the qiniu repository because I'm not sure if this is an exception for qiniu or for pkg.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions