yeswework / fabrica-dev-kit

A toolkit for faster, smoother WordPress 5 development
https://fabri.ca/
MIT License
274 stars 27 forks source link

fdk setup errors #20

Closed dsuriano closed 5 years ago

dsuriano commented 7 years ago

When running fdk setup, the build process errors out on missing dependencies:

postcss-reporter webpack js-yaml

Either manually installing them into a project, or globally adding them into /dev/package.json seems to fix the errors.

tiojoca commented 7 years ago

Where did you get these errors and can you copy them here? Those modules are dependencies of other dependencies in package.json and should be installed automatically by npm when installing these.

dsuriano commented 7 years ago

Reproduction steps

After running npm install fabrica-dev-kit -g and creating my project directory:

  1. fdk init
  2. fdk setup

The build process is successful until the WordPress theme builds, then:

[Fabrica] 🕑  Waiting for 'fabrica_wp' container...
[Fabrica] 🏭  Web server running at port 32769
[Fabrica] 🏭  Installing WordPress...
Success: WordPress installed successfully.
Success: Rewrite rules flushed.
Success: Rewrite structure set.
[Fabrica] 🏭  Building WordPress theme...
module.js:338
    throw err;
    ^

Error: Cannot find module 'postcss-reporter'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/Sites/fabrica/gulpfile.js:24:20)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
[Fabrica] ⚠️  Gulp 'build' task failed
  1. npm install postcss-reporter
  2. fdk setup --reinstall

Next error:

[Fabrica] 🕐  Waiting for 'fabrica_wp' container...
[Fabrica] 🏭  Web server running at port 32769
[Fabrica] 🏭  Installing WordPress...
WordPress is already installed.
Success: Rewrite rules flushed.
Success: Rewrite structure set.
[Fabrica] 🏭  Building WordPress theme...
module.js:338
    throw err;
    ^

Error: Cannot find module 'webpack'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/Sites/fabrica/gulpfile.js:32:12)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
[Fabrica] ⚠️  Gulp 'build' task failed
  1. npm install webpack
  2. fdk setup --reinstall

Next error:

[Fabrica] 🕐  Waiting for 'fabrica_wp' container...
[Fabrica] 🏭  Web server running at port 32769
[Fabrica] 🏭  Installing WordPress...
WordPress is already installed.
Success: Rewrite rules flushed.
Success: Rewrite structure set.
[Fabrica] 🏭  Building WordPress theme...
module.js:338
    throw err;
    ^

Error: Cannot find module 'js-yaml'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/Sites/fabrica/gulpfile.js:33:9)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
[Fabrica] ⚠️  Gulp 'build' task failed
  1. npm install js-yaml
  2. fdk setup --reinstall

At this point, the build is successful and the script completes. I can run gulp and everything works.

If I add the 3 missing dependencies above to /usr/local/lib/node_modules/fabrica-dev-kit/dev/package.json (macOS), the next time I setup a new project using fdk init then fdk setup, everything installs successfully.

gustavorps commented 5 years ago

Hello everyone!

I think this issue can closed. What do you think?

tiojoca commented 5 years ago

Closing this. If this happens again please let us know.