search

Home  >  Q&A  >  body text

node.js - 关于nw.js打包的问题

最近有个项目需要把公司的一个网站打包成电脑的桌面应用,网上搜了一下决定用nw.js来做,搞完之后本地预览都正常,但是在用nw-builder进行打包的时候总是出现各种问题。

C:\Users\caojianfei\AppData\Roaming\npm\node_modules\nw\nwjs\application>node builder.js
Using v0.15.4
Create cache folder in C:\Users\caojianfei\AppData\Roaming\npm\node_modules\nw\nwjs\application\cache\0.15.4
Downloading: http://dl.nwjs.io/v0.15.4/nwjs-sdk-v0.15.4-win-x64.zip
undefined
Unable to download NWjs.

上面的是一种,还有的就是下载到一半的时候就停了,眼看就要成功了就不行了,真是莫名奇妙,期间换过镜像什么的都不行。当然也成功过一次,可惜那是个测试的。

有人知道该怎么办嘛?这个问题困扰了我两天了,解决不了实在难受啊。或者还有其他的办法可以打包吗?

高洛峰高洛峰2854 days ago915

reply all(4)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 15:17:43

    The image cannot handle the prebuilt part of downloading, install vpn, and then go to the official npm registry and try again

    reply
    0
  • 阿神

    阿神2017-04-17 15:17:43

    C:\Users\caojianfei\AppData\Roaming\npm\node_modules\nw\nwjs\application>node builder.js
    Using v0.15.4
    Create cache folder in C:\Users\caojianfei\AppData\Roaming\npm\node_modules\nw\nwjs\application\cacherrreee.15.4
    Downloading: http://dl.nwjs.io/v0.15.4/nwjs-sdk-v0.15.4-win-x64.zip
     downloading [--------------] 1% 

    Sometimes the download stops when it reaches 80 or 90, and then after a long time, an error is reported. I am speechless

    reply
    0
  • PHPz

    PHPz2017-04-17 15:17:43

    I use NSIS packaging and use HMNISEdit to generate or edit packaging scripts.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 15:17:43

    Switch to the yarn source management tool and the download is successful. You can try it

    reply
    0
  • Cancelreply