Grunt assemble - strange 'module not found' issue

639 views Asked by At

I'm adapting an existing project to use Grunt, Assemble and other workflow tools. I have the workflow working on one machine, but when I try to run the Gruntfile on a different system I get an error:

[/home/ian/workspace/myproject]  (master)
ian@ian-desktop $ grunt assemble
Running "assemble:pages" (assemble) task

Warning: Cannot find module '/home/ian/workspace/myproject/node_modules/
  grunt-assemble/node_modules/assemble/node_modules/handlebars-helpers/
  lib/helpers/home/ian/workspace/myproject/node_modules/grunt-assemble/
  node_modules/assemble/node_modules/handlebars-helpers/lib/helpers/code.js' 
  Use --force to continue.

Aborted due to warnings.

The path that Grunt is trying to load is completely messed up (note the re-occurrence of the cwd about halfway through), but the filename it's looking for - code.js - is installed locally (by npm -i):

[/home/ian/workspace/myproject]  (master)
ian@ian-desktop $ find . -name code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
  handlebars-helpers/node_modules/remarkable/lib/rules_block/code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
  handlebars-helpers/test/code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
  handlebars-helpers/lib/helpers/code.js
./node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/
  lib/nodes/code.js

Both the systems I'm working on are Ubuntu 14.10, so shouldn't differ in any material way. Node -v gives v0.10.33, npm -v gives 2.1.5. I've tried:

  • checking out a fresh copy of the entire project from git
  • clearing all Bash environment vars before running Grunt

I'm having a hard time figuring out what's at the root of the different behaviour of the same code on two similar machines. Other tasks in my Gruntfile seem to be working fine, it's just the assemble task that's broken. Suggestions of where to look, or debug techniques to try, would be very welcome!

0

There are 0 answers