I’m working on a website that is running sage 8.5.1, and I’m running into some issues with gulp watch.
I’ve done all of the following:
Install gulp and Bower globally with npm install -g gulp bower
Navigate to the theme directory, then run npm install
Run bower install
But when I run gulp watch, I get these issues:
Error: Cannot find module ‘gulp-cli’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:659:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/usr/local/lib/node_modules/gulp/bin/gulp.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
We’ll need to know what operating system you’re running, and also what you’ve done to troubleshoot this issue so that we’re not re-treading ground you’ve already walked.
I’m running Mac OS High Sierra, and I’ve managed to fix the issue above. But I am now getting this error when running gulp watch within the template directory:
gulp watch[8188]: …/src/node_contextify.cc:633:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()’ failed.
I have done a bit of Googling, which suggested downgrading node.js, but that didn’t seem to help either so I stuck with the suggested version on the node website.
Sage 8 requires Node 4.5. We recommend using nvm to switch between Node versions as needed. Make sure you’ve followed the getting started documentation for Sage to install nvm. Those docs are written for Sage 9, so when they say to install Node lts/carbon, use 4.5 instead.