Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with gulp init #5

Open
wayne-dooley-nih opened this issue Jan 21, 2022 · 6 comments
Open

Problems with gulp init #5

wayne-dooley-nih opened this issue Jan 21, 2022 · 6 comments
Assignees

Comments

@wayne-dooley-nih
Copy link

Hi all -- I'm attempting to complete the tutorial, and I'm running into a snag at part two, step 7. When I attempt the 'npx gulp init', I receive the following errors:

 ~/uswds-tutorial  dooleywm $  npx gulp init
[16:12:26] Using gulpfile ~/uswds-tutorial/gulpfile.js
[16:12:26] Starting 'init'...
[16:12:26] Starting 'theme'...
Copying USWDS theme files to ./_theme
[16:12:26] 'theme' errored after 858 μs
[16:12:26] TypeError: paths.src.theme.replaceAll is not a function
    at theme (/Users/dooleywm/uswds-tutorial/node_modules/@uswds/compile/gulpfile.js:87:43)
    at bound (domain.js:416:15)
    at runBound (domain.js:427:12)
    at asyncRunner (/Users/dooleywm/uswds-tutorial/node_modules/async-done/index.js:55:18)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
[16:12:26] 'init' errored after 2.8 ms

Here's the contents of my gulpfile.js:

const uswds = require('@uswds/compile');

uswds.paths.dist.theme = './_theme';

exports.init = uswds.init;
exports.compile = uswds.compile;
exports.watch = uswds.watch;

Appreciate your help!

@kristenmyers
Copy link

I am running into the same problem.

@kristenmyers
Copy link

kristenmyers commented Jan 25, 2022

@wayne-dooley-nih I searched the error messaging we were getting: TypeError: paths.src.theme.replaceAll is not a function and came upon this page. It said that often this error is received when the node.js version is not up-to-date.
So then I ran node --version and saw that I was on version 14 of node.js and that there is version 17.4.0 released, so I followed the directions here to update my version of node.js, then tried running npx gulp init and then it worked!

Successful output:

Myers19Mac2:uswds-tutorial kristen.myers$ npx gulp init
[14:52:26] Using gulpfile ~/Documents/GitHub/uswds-tutorial/gulpfile.js
[14:52:26] Starting 'init'...
[14:52:26] Starting 'theme'...
Copying USWDS theme files to ./_theme
[14:52:26] Starting 'fonts'...
[14:52:26] Starting 'images'...
[14:52:26] Starting 'js'...
Copying USWDS fonts to ./assets/uswds/fonts
Copying USWDS images to ./assets/uswds/img
Copying USWDS JavaScript to ./assets/uswds/js
[14:52:27] Finished 'js' after 211 ms
[14:52:27] Finished 'theme' after 223 ms
[14:52:27] Finished 'fonts' after 390 ms
[14:52:28] Finished 'images' after 1.51 s
[14:52:28] Starting 'buildSass'...
[14:52:28] Starting 'buildSprite'...

I hope this helps you!

@wayne-dooley
Copy link

@kristenmyers -- Yep, that was it! I upgraded node version, and all is working well. Thanks for the help!

@mejiaj
Copy link
Contributor

mejiaj commented Jan 25, 2022

Thank you for sharing @kristenmyers!

@fpigeonjr
Copy link
Contributor

completed the tutorial using node16 and didn't run into any issues.
btw, you can run nvm use at the root of any project that has a .nvmrc and know that it will be set to the correct version.

@mejiaj
Copy link
Contributor

mejiaj commented Dec 8, 2022

@thisisdano this should be safe to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants