yeswework/fabrica-dev-kit

fdk setup errors

dsuriano opened this issue ยท 4 comments

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.

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.

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.

Hello everyone!

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

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