部署者:6.4.6 操作系统:Ubuntu 18.04 LTS npm:5.6.0 节点:8.11.4
您好,当使用部署程序部署时,我的 npm 安装需要 157 秒,但是当我尝试在 ssh (使用同一用户)时重新创建该步骤时,当 node_modules 到位时,当没有(30 秒)和部署人员的 npm 期间,它需要 13~s安装我有 node_modules 存在。似乎问题是使用部署程序时某种缓存不起作用。
手动执行时:
npm install
> node-sass@4.8.3 install /var/www/site/releases/4/node_modules/node-sass
> node scripts/install.js
Cached binary found at /home/deployer/.npm/node-sass/4.8.3/linux-x64-57_binding.node
使用部署器时:
➤ Executing task npm:install
[dev] > cp -R /var/www/site/releases/6/node_modules /var/www/site/releases/7/node_modules
[dev] > cd /var/www/site/releases/7 && npm install
[dev] < > node-sass@4.8.3 install /var/www/site/releases/7/node_modules/node-sass
[dev] < > node scripts/install.js
[dev] < Downloading binary from https://github.com/sass/node-sass/releases/download/v4.8.3/linux-x64-67_binding.node
[dev] < Cannot download "https://github.com/sass/node-sass/releases/download/v4.8.3/linux-x64-67_binding.node":
[dev] < HTTP error 404 Not Found
[dev] < Hint: If github.com is not accessible in your location
[dev] < try setting a proxy via HTTP_PROXY, e.g.
[dev] < export HTTP_PROXY=http://example.com:1234
[dev] < or configure npm proxy via
[dev] < npm config set proxy http://example.com:8080
手动执行时它会获取缓存的二进制文件,而通过部署程序执行时它不会 - 不知道为什么会发生这种情况 - 使用部署程序部署时我是否可能缺少一些环境变量?