所以我想编译一个nodejs项目一windows 可执行文件所以我最终使用https://github.com/pmq20/node-packer但是当我尝试用这个命令编译它时
C:\Users\Samuel\Desktop\default>nodec-v1.5.0-x64.exe test.js
然后我通过以下步骤:
-> mkdir -p C:/Users/Samuel/AppData/Local/Temp/nodec
-> rm -rf C:/Users/Samuel/AppData/Local/Temp/nodec/__work_dir__
-> mkdir -p C:/Users/Samuel/AppData/Local/Temp/nodec/__work_dir__
-> cp -r "C:/Users/Samuel/Desktop/default" "C:/Users/Samuel/AppData/Local/Temp/nodec/__work_dir__/__enclose_io_memfs__"
-> cd C:/Users/Samuel/AppData/Local/Temp/nodec/__work_dir__/__enclose_io_memfs__
-> Running ["\"npm\" -v"]
5.5.1
-> Running ["\"npm\" install --production"]
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
up to date in 0.681s
-> cd C:/Users/Samuel/Desktop/default
-> cd C:/Users/Samuel/AppData/Local/Temp/nodec/__work_dir__/__enclose_io_memfs__
-> cd C:/Users/Samuel/Desktop/default
-> cd C:/Users/Samuel/AppData/Local/Temp/nodec/node-8.3.0-1.5.0
-> rm -f deps/libsquash/sample/enclose_io_memfs.squashfs
-> rm -f deps/libsquash/sample/enclose_io_memfs.c
-> Running ["mksquashfs -version"]
### CRAP ###
-> Running ["mksquashfs \"C:/Users/Samuel/AppData/Local/Temp/nodec/__work_dir__\" deps/libsquash/sample/enclose_io_memfs.squashfs"]
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on deps/libsquash/sample/enclose_io_memfs.squashfs, block size 131072.
[============================================================================================================================================/] 277/277 100%
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
compressed data, compressed metadata, compressed fragments, compressed xattrs
duplicates are removed
Filesystem size 31756.60 Kbytes (31.01 Mbytes)
91.18% of uncompressed filesystem size (34828.93 Kbytes)
Inode table size 569 bytes (0.56 Kbytes)
43.17% of uncompressed inode table size (1318 bytes)
Directory table size 128 bytes (0.12 Kbytes)
81.53% of uncompressed directory table size (157 bytes)
Number of duplicate files found 0
Number of inodes 7
Number of files 5
Number of fragments 1
Number of symbolic links 0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 2
Number of ids (unique uids + gids) 1
Number of uids 1
Samuel (197609)
Number of gids 1
Samuel (197609)
-> cd C:/Users/Samuel/Desktop/default
-> cd C:/Users/Samuel/AppData/Local/Temp/nodec/node-8.3.0-1.5.0
-> rm -f Release/obj/node/node_main.obj
-> rm -f Debug/obj/node/node_main.obj
-> cd C:/Users/Samuel/Desktop/default
-> cd C:/Users/Samuel/AppData/Local/Temp/nodec/node-8.3.0-1.5.0
但我在这一步失败了
-> Running ["call vcbuild.bat x64"]
Failed running ["call vcbuild.bat x64"]
C:\Users\Samuel\Desktop\default>
我认为这与 Visual Studio 有关,但我不确定,也不知道如何解决这个问题(Ps:我已经在 github 上打开了一个问题,但没有结果)。
提前致谢