Deploy error at npm install

I’m updating a Trellis instance. The initial provision and deployment works fine. However, after migrating the previous database, an error keeps occurring during deployment:

TASK [deploy : Run npm install] ************************************************
System info:
  Ansible 2.0.2.0; Darwin
  Trellis at "Enable per-site setup for permalink structure"
---------------------------------------------------
fatal: [staging.#####.com]: FAILED! => {"changed": true, "cmd": ["npm", "install"], "delta":     "0:00:11.188344", "end": "2016-10-27 17:06:11.467190", "failed": true, "rc": 1, "start": "2016-10-27     17:06:00.278846", "stderr": "", "stdout": "sage@9.0.0-alpha.3 /Users/#####/Sites/#####/site/web/app/themes/sage\n└── (empty)", "stdout_lines": ["sage@9.0.0-alpha.3 /Users/#####/Sites/#####/site/web/app/themes/sage", "└── (empty)"], "warnings": []}

I’m not sure what this means. Can someone help? Thanks!

Renamed thread title as it’s not relevant to your error, it’s just telling you what version your copy of Trellis is at.

Can you share your deploy file with the npm install task?

You can also SSH into your server and run npm install manually in that directory to get more information.

Hey guys. The deploy file includes:

- name: Install Composer dependencies
  command: composer install --no-ansi --no-dev    --no-interaction --no-progress --optimize-autoloader    --no-scripts
  args:
    chdir: "{{ deploy_helper.new_release_path }}/web/app/themes/sage"

- name: Run npm install
  command: npm install
  connection: local
  args:
    chdir: "{{ project.local_path }}/web/app/themes/sage"

- name: Run npm build
  command: npm run build:production
  connection: local
  args:
    chdir: "{{ project.local_path }}/web/app/themes/sage"

- name: Copy project local files
  synchronize:
    src: "{{ project.local_path }}/web/app/themes/sage/dist"
    dest: "{{ deploy_helper.new_release_path }}/web/app/themes/sage"
    group: no
    owner: no
    rsync_opts: --chmod=Du=rwx,--chmod=Dg=rx,--chmod=Do=rx,--   chmod=Fu=rw,--chmod=Fg=r,--chmod=Fo=r   

I ran npm install on the server and was told that The program 'npm' is currently not installed.. So, I installed npm and then ran npm install again. It went through the installation process, but then hit an error at:

npm ERR! Error: No compatible version found: monkey-hot-loader@'github:rmarscher/monkey-hot-loader#webpack2-import'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:719:10)
npm ERR!     at /usr/share/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 4.4.0-45-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /srv/www/#####/releases/20161028131811/web/app/themes/sage
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10

For reference, this is part of setting up a staging site after upgrading the Roots stack from a previous version. This includes migrating from Sage 8 to 9 (alpha 3). Everything appears to work properly in the local dev environment and during the initial staging provision / deploy.

Thanks for the help!

So, I rebuilt the stack step by step and migrated the previous version of the db. It seems to be working now. No more npm deployment errors. Wondering if one of the extra npm packages was causing an issue…

Thanks again for the help!