New npm workflow. What am I doing wrong?

I’ve returned to Sage after not having done a theme from scratch for a few month.
I got pretty comfortable with the Sage workflow.

I want to start a new theme so I cloned the Sage repo. I noticed pretty quickly that it’s different from the Sage I’m used to.

I noticed that there’s no gulpfile. I picked up pretty quickly that building is done using npm tasks instead, thanks to the readme.

So once I’d installed the npm modules I ran ‘npm run build’. This returned a handful of errors:

ERROR in /var/www/sagetest/wp-content/themes/sagetest/node_modules/eslint/lib/eslint.js:12
const assert = require("assert"),
Use of const in strict mode.
 @ multi main

ERROR in /var/www/sagetest/wp-content/themes/sagetest/node_modules/eslint/lib/eslint.js:12
const assert = require("assert"),
Use of const in strict mode.
 @ multi customizer

ERROR in /var/www/sagetest/wp-content/themes/sagetest/node_modules/eslint/lib/eslint.js:12
const assert = require("assert"),
Use of const in strict mode.
 @ multi main

I’m assuming that there’s nothing run with the repo, and that I’ve skipped a necessary step while setting up the project?

The next thing I tried was ‘npm run build’. This returns the same errors and doesn’t exit.
I made a minor change in the default main.scss file and noticed activity in the terminal running the ‘watch’ command.

The activity outputs (among other things) the same errors.

After I make changes, there is no change in change in the styling of my test site.
In the network tab I notice that the request for ‘main.css’ returns a 404.
By default the site is trying to load ‘…/dist/styles/main.css’. However the dist directory doesn’t exist.

I’m guessing that I’ve missed some setup steps.
What steps have I missed?

Also, apart from the readme, is there any new documentation on setting up a Sage project?
It looks like the Sage documentation under the section ‘Theme Development and Building’ is outdated.


I’ve just noticed something:

When I created my project I cloned from master, which is using the alpha of Sage 9.
So that tells me that the documentation on isn’t outdated.
Rather, I’ve jumped ahead.

But now that I know I’m working with this version I might as well continue to experiment.

So my other question about what I need to do to get the workflow running smoothly is still pertinent.

I am getting the same error as well. Any help appreciated.

What platform are you developing on? The latest version runs npm run build just fine on my Mac. Perhaps it’s a platform issue?

1 Like

I was able to fix it. What I did was, follow instructions here: SyntaxError: Use of const in strict mode?

Then I ran npm rebuild node-sass

1 Like

Yeah, it might be a platform issue.
I’m using npm from the default repos on ubuntu 16.04.

I ran into a similar issue w/ node sass bugging out. Hasn’t been resolved yet, but I’ll add here if I get additional errors.

For me it was the version of Node I was using. I updated to v4.5.0 per the docs request, deleted my npm directory and ran npm install again.

Gulp is now working.

Help! I’m getting a Failed to load resource: the server responded with a status of 404 (Not Found) for main.css and have tried all of the above solutions.
My setup is on MAMP, Bourbon Sage v.8.5
php is v.5.6.28
node is v.7.6.0
gulp is v.3.9.1
and bower is v.1.8.0

BrowserSync seems fine. My only issue is no styles. (No biggie…just a custom theme that completely needs styles ;)!

Any suggestions?