ahmadawais / WPGulp

An advanced Gulp workflow for WordPress development with extensive documentation. Used by 40,000+ themes and plugins.
https://twitter.com/MrAhmadAwais/
MIT License
1.76k stars 303 forks source link

Failing on initial build after install #200

Closed mware closed 3 years ago

mware commented 3 years ago

Bug Report

Expected Behavior

I've been using WPGulp on several projects for a few years now and love it. But on the last 3 installs this week, early February 2021, the initial build fails, noting a fail in the start script. I run npx wpgulp adjust wpgulp.config.js to my particulars then run npm start Files don't compile. Get a debug log file explaining the errors. See below.

(Write what you thought would happen.) Normally, my SCSS files compile and the watcher is running in my theme.

Actual Behavior

Screen Shot 2021-02-12 at 11 54 25 AM

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.4.1
3 info using node@v11.0.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle your-project@0.0.1~prestart: your-project@0.0.1
6 info lifecycle your-project@0.0.1~start: your-project@0.0.1
7 verbose lifecycle your-project@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle your-project@0.0.1~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/macpro/Local Sites/soh/app/public/wp-content/themes/remake-child/node_modules/.bin:/Users/macpro/.rvm/gems/ruby-2.1.2/bin:/Users/macpro/.rvm/gems/ruby-2.1.2@global/bin:/Users/macpro/.rvm/rubies/ruby-2.1.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/macpro/.rvm/gems/ruby-2.1.2/bin:/Users/macpro/.rvm/gems/ruby-2.1.2@global/bin:/Users/macpro/.rvm/rubies/ruby-2.1.2/bin:/Users/macpro/.rvm/bin:/Users/macpro/.rvm/bin
9 verbose lifecycle your-project@0.0.1~start: CWD: /Users/macpro/Local Sites/soh/app/public/wp-content/themes/remake-child
10 silly lifecycle your-project@0.0.1~start: Args: [ '-c', 'gulp' ]
11 silly lifecycle your-project@0.0.1~start: Returned: code: 1  signal: null
12 info lifecycle your-project@0.0.1~start: Failed to exec start script
13 verbose stack Error: your-project@0.0.1 start: `gulp`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:962:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid your-project@0.0.1
15 verbose cwd /Users/macpro/Local Sites/soh/app/public/wp-content/themes/remake-child
16 verbose Darwin 20.3.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v11.0.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error your-project@0.0.1 start: `gulp`
22 error Exit status 1
23 error Failed at the your-project@0.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Steps to Reproduce

  1. inside theme, run npx wpgulp

  2. edit wpgulp.config

  3. npm start

  4. node -v: 11.0.0

  5. npm -v: 6.4.1

  6. yarn --version (if you use Yarn):

Then, specify:

  1. Operating system: mac OS Bug Sur 11.2.1
  2. Browser and version (if relevant): all browsers

Possible Solution

Reproducible Demo

Not applicable. Simply doesn't compile. I've blown away the node_modules and reinstalled several times on 2 different local sites. Same results every time.

ahmadawais commented 3 years ago

Hi @mware, you are using an old and unsupported version of Node.js. I recommend that you update your node version, which may be the cause here. At least use the LTS version.

If you sign up on NodeCLI.com (free signup at the top), you'll get an email for the first 12 free videos; in these videos, I teach installing Node.js and its different versions to keep up using a script called n. That should be helpful.

mware commented 3 years ago

Face palm. Thanks @ahmadawais . That worked.

grayayer commented 3 years ago

I'm having the same problem. What version should we be using of Node?

ahmadawais commented 3 years ago

The active or maintenance LTS version should work. Watch this video I made https://nodecli.com/n