Fixing Foundation for Emails on node 10.15.3 in October 2019

If you have been wanting to use Foundation for Emails, you’ll notice that the email building framework has not been updated since 2016. That’s over 3 years ago.

June 30th 2016 was the last time the framework was updated.

Here is what you need to do to get the packages building to start your next email template.

1. If you have not already, install the foundation-cli tooling for node.

npm install --global foundation-cli

2. Then build your email project.

foundation new --framework emails

3. Then you’ll notice the first issue the framework has when building.

The node modules did not install. Change directories into the project folder so that we can fix the issue.

Installation instructions for the foundation for emails framework

I like to use a tool called npm-check to update my node modules. When you have npm-check installed run npm-check -u in the project directory to see a list of all the outdated packages.

npm install npm-check -g
npm-check -u

A list of the outdated npm packages

Update all the modules and you’ll then see the node_modules directory.

The updated node modules

4. Now we can build the project

Now when you run npm run build, you’ll still get an error. The issue here is how gulp was added to the framework. We will have to fix this.

Gulp error in terminal

First, open the package.json files for the project and delete the line for gulp under the devDependencies.

The project package.json file where the gulp line is located

Next, delete the package-lock.json file. Reinstall gulp with npm install gulp -D. Then finally run npm run build.

rm package-lock.json
npm install gulp -D
npm run build

Fixing the gulp issues preventing the build process

Now you can use the framework as intended.

The framework running in the browser