收藏
回答

云函数安装 npm install node-xlsx依赖一直不成功?

由于想用excel文件导入和导出微信小程序数据库内容,按照百度高人的指点,需要再云函数里先安装npm install node-xlsx但一致未成功,根本就卡住不动,然后提示如下:

PS D:\Private Files\微信小程序\拓领预约系统\拓领仓库预约系统1.1(+logs)\cloud> npm install node-xlsx

npm ERR! code ETIMEDOUT

npm ERR! errno ETIMEDOUT

npm ERR! network request to https://registry.npmjs.org/node-xlsx failed, reason: connect ETIMEDOUT 104.16.25.35:443

npm ERR! network This is a problem related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly.  See: 'npm help config'


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\jazhang\AppData\Roaming\npm-cache\_logs\2020-07-01T14_48_07_145Z-debug.log

我的问题是:

  1. 以上原因是什么?我看大意是网络不好?
  2. 按照此类xlsx依赖包,除了针对某一特定云函数安装依赖,还可以在哪里统一一次性安装依赖,如何操作?

请高人指定!感谢!

回答关注问题邀请回答
收藏

2 个回答

  • Jason_亮 🇨🇳
    Jason_亮 🇨🇳
    2020-07-02

    PS D:\Private Files\微信小程序\拓领预约系统\拓领仓库预约系统1.1(+logs)\cloud\getbookinfoallwhs> npm install node-xlsx

    npm notice created a lockfile as package-lock.json. You should commit this file.

    npm WARN getbookinfoallwhs@1.0.0 No description

    npm WARN getbookinfoallwhs@1.0.0 No repository field.


    + node-xlsx@0.15.0

    added 13 packages from 4 contributors and audited 13 packages in 4.229s

    found 0 vulnerabilities

    2020-07-02
    有用
    回复
  • 白宦成 #Linux中国
    白宦成 #Linux中国
    2020-07-02

    本地网络问题。

    2020-07-02
    有用
    回复 1
    • Jason_亮 🇨🇳
      Jason_亮 🇨🇳
      2020-07-02
      谢谢,换了个网络,跑了一下,请帮忙看看是否成功?
      2020-07-02
      回复
登录 后发表内容
问题标签