Hey everyone. I’ve been using the older version of sage now for a while but I decided it’s time to update so I can learn some new tricks as well. I even bought the book and tried to follow it step-by-step, here is what I did:
-Set up a simple wordpress installation
-Copied sage 9 into my theme folder; I did it this way because composer create-project roots/sage your-theme-name
according to the book, downloaded one of the older versions for some reason.
-ran composer install
-installed yarn globally
-ran yarn
Up until this point it seemed fine, however when I ran yarn build I got the following error:
$ yarn build
yarn run v1.6.0
$ webpack --progress --config resources/assets/build/webpack.config.js
module.js:549
throw err;
^
Error: Cannot find module 'C:\webworks\starter\wp-content\themes\webpack\bin\webpack.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
It seems to me it looks for webpack in a wrong folder, basically leaves out the theme-name\node_modules part or wherever it should be. Does anybody know what did I miss here? Where can I change this?
Thank you in advance. Here is the full output, also I use win10 and node 8.11.1
Rawhloe@DESKTOP-HPETH74 MINGW64 /c/webworks/starter/wp-content/themes/startertheme
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 27 installs, 0 updates, 0 removals
- Installing composer/installers (v1.5.0): Loading from cache
- Installing symfony/polyfill-mbstring (v1.7.0): Loading from cache
- Installing symfony/translation (v4.0.8): Loading from cache
- Installing nesbot/carbon (1.27.0): Loading from cache
- Installing psr/simple-cache (1.0.1): Loading from cache
- Installing psr/container (1.0.0): Loading from cache
- Installing illuminate/contracts (v5.6.17): Loading from cache
- Installing doctrine/inflector (v1.3.0): Loading from cache
- Installing illuminate/support (v5.6.17): Loading from cache
- Installing illuminate/container (v5.6.17): Loading from cache
- Installing illuminate/events (v5.6.17): Loading from cache
- Installing psr/log (1.0.2): Loading from cache
- Installing symfony/debug (v4.0.8): Loading from cache
- Installing symfony/finder (v4.0.8): Loading from cache
- Installing illuminate/filesystem (v5.6.17): Loading from cache
- Installing illuminate/view (v5.6.17): Loading from cache
- Installing illuminate/config (v5.6.17): Loading from cache
- Installing roots/sage-lib (9.0.1): Loading from cache
- Installing symfony/yaml (v3.4.8): Loading from cache
- Installing hassankhan/config (0.10.0): Loading from cache
- Installing brain/hierarchy (2.3.1): Loading from cache
- Installing soberwp/controller (9.0.0-beta.4): Loading from cache
- Installing symfony/process (v3.4.8): Loading from cache
- Installing symfony/console (v4.0.8): Loading from cache
- Installing illuminate/console (v5.6.17): Loading from cache
- Installing roots/sage-installer (1.3.6): Loading from cache
- Installing squizlabs/php_codesniffer (2.9.1): Loading from cache
symfony/translation suggests installing symfony/config ()
illuminate/support suggests installing symfony/var-dumper (Required to use the dd function (~4.0).)
illuminate/filesystem suggests installing league/flysystem (Required to use the Flysystem local and FTP drivers (~1.0).)
illuminate/filesystem suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
illuminate/filesystem suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (~1.0).)
illuminate/filesystem suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
illuminate/filesystem suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (~1.0).)
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/lock ()
illuminate/console suggests installing dragonmantank/cron-expression (Required to use scheduling component (~2.0).)
illuminate/console suggests installing guzzlehttp/guzzle (Required to use the ping methods on schedules (~6.0).)
Generating autoload files
Rawhloe@DESKTOP-HPETH74 MINGW64 /c/webworks/starter/wp-content/themes/startertheme
$ npm install -g yarn
C:\Program Files\nodejs\yarnpkg -> C:\Program Files\nodejs\node_modules\yarn\bin\yarn.js
C:\Program Files\nodejs\yarn -> C:\Program Files\nodejs\node_modules\yarn\bin\yarn.js
+ yarn@1.6.0
updated 1 package in 1.299s
Rawhloe@DESKTOP-HPETH74 MINGW64 /c/webworks/starter/wp-content/themes/startertheme
$ yarn
yarn install v1.6.0
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.3: The platform "win32" is incompatible with this module.
info "fsevents@1.2.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > stylelint-webpack-plugin@0.10.4" has incorrect peer dependency "webpack@^1.13.2 || ^2.7.0 || ^3.11.0 || ^4.4.0".
[5/5] Building fresh packages...
success Saved lockfile.
Done in 50.06s.
Rawhloe@DESKTOP-HPETH74 MINGW64 /c/webworks/starter/wp-content/themes/startertheme
$ yarn build
yarn run v1.6.0
$ webpack --progress --config resources/assets/build/webpack.config.js
module.js:549
throw err;
^
Error: Cannot find module 'C:\webworks\starter\wp-content\themes\webpack\bin\webpack.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
edit: oh yeah one more thing, I tried to weed out bootstrap beforehand in package.json, not sure if it’s important.