roots / sage-installer

Sage 9 installer
https://github.com/roots/sage
MIT License
30 stars 90 forks source link

Composer Installation on Windows #2

Closed Shirkit closed 7 years ago

Shirkit commented 7 years ago

Ok, so following @QWp6t 's suggestion, I've posted the issue here.

Trying the composer installation on Windows 10.1 is resulting in an error.

I followed the installation instructions on the Github repo composer create-project roots/sage your-theme-name dev-master.

After the composer installation failed, doing sage meta and sage config, as suggested, results in exceptions being thrown, and sage preset prolly cannot run since the setup is not finished yet.

Windows 10.1 PHP 7.1.7 Node 7.6.0 NPM 4.1.2 Local build.

E:\Trabalho\ShirkitTheme>composer create-project roots/sage sage-master dev-master
Installing roots/sage (dev-master 8691074b29c4c09dae40f0f0c33dc2b51d9292e2)
  - Installing roots/sage (dev-master master): Cloning master from cache
Created project in sage-master
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 26 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.3.0): Loading from cache
  - Installing paragonie/random_compat (v2.0.10): Loading from cache
  - Installing illuminate/contracts (v5.4.27): Loading from cache
  - Installing doctrine/inflector (v1.1.0): Loading from cache
  - Installing illuminate/support (v5.4.27): Loading from cache
  - Installing illuminate/container (v5.4.27): Loading from cache
  - Installing illuminate/events (v5.4.27): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing symfony/debug (v3.3.4): Loading from cache
  - Installing symfony/finder (v3.3.4): Loading from cache
  - Installing illuminate/filesystem (v5.4.27): Loading from cache
  - Installing illuminate/view (v5.4.27): Loading from cache
  - Installing illuminate/config (v5.4.27): Loading from cache
  - Installing roots/sage-lib (9.0.0-beta.3): Loading from cache
  - Installing symfony/yaml (v3.3.4): Loading from cache
  - Installing hassankhan/config (0.10.0): Loading from cache
  - Installing brain/hierarchy (2.3.0): Loading from cache
  - Installing soberwp/controller (dev-master e9358ff): Cloning e9358ff900 from cache
  - Installing symfony/polyfill-mbstring (v1.4.0): Loading from cache
  - Installing symfony/translation (v3.3.4): Loading from cache
  - Installing nesbot/carbon (1.22.1): Loading from cache
  - Installing symfony/process (v3.3.4): Loading from cache
  - Installing symfony/console (v3.3.4): Loading from cache
  - Installing illuminate/console (v5.4.27): Loading from cache
  - Installing roots/sage-installer (1.1.0): Loading from cache
  - Installing squizlabs/php_codesniffer (2.9.1): Loading from cache
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
illuminate/support suggests installing symfony/var-dumper (Required to use the dd function (~3.2).)
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-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
symfony/translation suggests installing symfony/config ()
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/filesystem ()
illuminate/console suggests installing guzzlehttp/guzzle (Required to use the ping methods on schedules (~6.0).)
illuminate/console suggests installing mtdowling/cron-expression (Required to use scheduling component (~1.0).)
Generating autoload files
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? Y
> Roots\Sage\Installer\ComposerScript::postCreateProject
Script Roots\Sage\Installer\ComposerScript::postCreateProject handling the post-create-project-cmd event terminated with an exception

  [Symfony\Component\Process\Exception\RuntimeException]
  TTY mode is not supported on Windows platform.

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

E:\Trabalho\ShirkitTheme>cd vendor
The system cannot find the path specified.

E:\Trabalho\ShirkitTheme>dir
 Volume in drive E is Dados
 Volume Serial Number is 04F5-6681

 Directory of E:\Trabalho\ShirkitTheme

03/08/2017  00:58    <DIR>          .
03/08/2017  00:58    <DIR>          ..
28/07/2017  16:25    <DIR>          bones-master
31/07/2017  00:04    <DIR>          node_modules
03/08/2017  00:58    <DIR>          sage-master
30/07/2017  00:54    <DIR>          xampp
               0 File(s)              0 bytes
               6 Dir(s)  84.271.640.576 bytes free

E:\Trabalho\ShirkitTheme>cd sage-master

E:\Trabalho\ShirkitTheme\sage-master>dir
 Volume in drive E is Dados
 Volume Serial Number is 04F5-6681

 Directory of E:\Trabalho\ShirkitTheme\sage-master

03/08/2017  00:58    <DIR>          .
03/08/2017  00:58    <DIR>          ..
03/08/2017  00:58               251 .editorconfig
03/08/2017  00:58                83 .gitattributes
03/08/2017  00:58    <DIR>          .github
03/08/2017  00:58               267 .gitignore
03/08/2017  00:58               814 .travis.yml
03/08/2017  00:58    <DIR>          app
03/08/2017  00:58            29.793 CHANGELOG.md
03/08/2017  00:58             1.196 composer.json
03/08/2017  00:58            53.273 composer.lock
03/08/2017  00:58    <DIR>          config
03/08/2017  00:58             1.087 LICENSE.md
03/08/2017  00:58           356.029 package-lock.json
03/08/2017  00:58             3.728 package.json
03/08/2017  00:58             2.310 phpcs.xml
03/08/2017  00:58             5.964 README.md
03/08/2017  00:58    <DIR>          resources
03/08/2017  00:58    <DIR>          vendor
03/08/2017  00:58           241.171 yarn.lock
              13 File(s)        695.966 bytes
               7 Dir(s)  84.271.640.576 bytes free

E:\Trabalho\ShirkitTheme\sage-master>cd vendor

E:\Trabalho\ShirkitTheme\sage-master\vendor>cd bin

E:\Trabalho\ShirkitTheme\sage-master\vendor\bin>dir
 Volume in drive E is Dados
 Volume Serial Number is 04F5-6681

 Directory of E:\Trabalho\ShirkitTheme\sage-master\vendor\bin

03/08/2017  00:58    <DIR>          .
03/08/2017  00:58    <DIR>          ..
03/08/2017  00:58               620 phpcbf
03/08/2017  00:58               134 phpcbf.bat
03/08/2017  00:58               619 phpcs
03/08/2017  00:58               133 phpcs.bat
03/08/2017  00:58               609 sage
03/08/2017  00:58               123 sage.bat
               6 File(s)          2.238 bytes
               2 Dir(s)  84.271.640.576 bytes free

E:\Trabalho\ShirkitTheme\sage-master\vendor\bin>sage.bat meta
PHP Warning:  file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/style.css): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Transformations\ThemeHeaders.php on line 30

Warning: file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/style.css): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Transformations\ThemeHeaders.php on line 30
PHP Warning:  file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets/config.json): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console\Commands\ConfigCommand.php on line 26

Warning: file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets/config.json): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console\Commands\ConfigCommand.php on line 26

  Roots\Sage\Installer\Console\Exceptions\ConfigureCommandException: FILE NOT
  FOUND:

      E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/style.css in
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console</>
  Commands\MetaCommand.php:37

  Stack trace:

  #0
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console</>
  Commands\Command.php(42):
  Roots\Sage\Installer\Console\Commands\MetaCommand->validate()

  #1
  E:\Trabalho\ShirkitTheme\sage-master\vendor\symfony\console\Application.php(8
  69):
  Roots\Sage\Installer\Console\Commands\Command->run(Object(Symfony\Component\C
  onsole\Input\ArgvInput),
  Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #2
  E:\Trabalho\ShirkitTheme\sage-master\vendor\symfony\console\Application.php(2
  23):
  Symfony\Component\Console\Application->doRunCommand(Object(Roots\Sage\Install
  er\Console\Commands\MetaCommand),
  Object(Symfony\Component\Console\Input\ArgvInput),
  Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #3
  E:\Trabalho\ShirkitTheme\sage-master\vendor\symfony\console\Application.php(1
  30):
  Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console
  \Input\ArgvInput), Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #4
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Applicat
  ion.php(23):
  Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\I
  nput\ArgvInput), Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #5
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\bin\sage(8):
  Roots\Sage\Installer\Application->run()

  #6 {main}

E:\Trabalho\ShirkitTheme\sage-master\vendor\bin>sage.bat config
PHP Warning:  file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/style.css): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Transformations\ThemeHeaders.php on line 30

Warning: file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/style.css): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Transformations\ThemeHeaders.php on line 30
PHP Warning:  file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets/config.json): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console\Commands\ConfigCommand.php on line 26

Warning: file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets/config.json): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console\Commands\ConfigCommand.php on line 26

  Roots\Sage\Installer\Console\Exceptions\ConfigureCommandException: FILE NOT
  FOUND:

  E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets/config.json
  in
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console</>
  Commands\ConfigCommand.php:48

  Stack trace:

  #0
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console</>
  Commands\Command.php(42):
  Roots\Sage\Installer\Console\Commands\ConfigCommand->validate()

  #1
  E:\Trabalho\ShirkitTheme\sage-master\vendor\symfony\console\Application.php(8
  69):
  Roots\Sage\Installer\Console\Commands\Command->run(Object(Symfony\Component\C
  onsole\Input\ArgvInput),
  Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #2
  E:\Trabalho\ShirkitTheme\sage-master\vendor\symfony\console\Application.php(2
  23):
  Symfony\Component\Console\Application->doRunCommand(Object(Roots\Sage\Install
  er\Console\Commands\ConfigCommand),
  Object(Symfony\Component\Console\Input\ArgvInput),
  Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #3
  E:\Trabalho\ShirkitTheme\sage-master\vendor\symfony\console\Application.php(1
  30):
  Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console
  \Input\ArgvInput), Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #4
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Applicat
  ion.php(23):
  Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\I
  nput\ArgvInput), Object(Roots\Sage\Installer\Console\Style\RootsStyle))

  #5
  E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\bin\sage(8):
  Roots\Sage\Installer\Application->run()

  #6 {main}

E:\Trabalho\ShirkitTheme\sage-master\vendor\bin>sage.bat preset
PHP Warning:  file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/style.css): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Transformations\ThemeHeaders.php on line 30

Warning: file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/style.css): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Transformations\ThemeHeaders.php on line 30
PHP Warning:  file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets/config.json): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console\Commands\ConfigCommand.php on line 26

Warning: file_get_contents(E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets/config.json): failed to open stream: No such file or directory in E:\Trabalho\ShirkitTheme\sage-master\vendor\roots\sage-installer\src\Console\Commands\ConfigCommand.php on line 26

 Which framework would you like to load? [Bootstrap]:
  [0] None
  [1] Bootstrap
  [2] Bulma
  [3] Foundation
  [4] Tachyons
 > 3

 Do you want to install Font Awesome? (yes/no) [no]:
 > yes

  [InvalidArgumentException]
  The "E:\Trabalho\ShirkitTheme\sage-master\vendor\bin/resources/assets" dire
  ctory does not exist.

preset [-Y|--overwrite] [-F|--fontawesome] [--] <framework>

E:\Trabalho\ShirkitTheme\sage-master\vendor\bin>
QWp6t commented 7 years ago

You have to run it from the theme directory.

In your case...

cd sage-master
vendor/bin/sage.bat meta
vendor/bin/sage.bat config
vendor/bin/sage.bat preset
Shirkit commented 7 years ago

Ooops 👍

Giovanni-Mattucci commented 6 years ago

Note that on Windows that you need to use backslashes:

cd sage-master
vendor\bin\sage.bat meta
vendor\bin\sage.bat config
vendor\bin\sage.bat preset

or you can wrap the path in quotes:

cd sage-master
"vendor/bin/sage.bat" meta
"vendor/bin/sage.bat" config
"vendor/bin/sage.bat" preset
pixelbrad commented 5 years ago

Tried spinning up a Sage project today, on a Windows machine.. I'm not having any success with the commands you've mentioned above.

C:\laragon\www\sage-theme\wp-content\themes\sage-theme
λ php vendor\bin\sage meta

dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../roots/sage-installer/bin" && pwd)

if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
   # We are in Cgywin using Windows php, so the path must be translated
   dir=$(cygpath -m "$dir");
fi

"${dir}/sage" "$@"

C:\laragon\www\sage-theme\wp-content\themes\sage-theme
λ php vendor\bin\sage.bat meta
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../roots/sage-installer/bin/sage
php "%BIN_TARGET%" %*

C:\laragon\www\sage-theme\wp-content\themes\sage-theme
λ php vendor\bin\sage.bat config
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../roots/sage-installer/bin/sage
php "%BIN_TARGET%" %*

C:\laragon\www\sage-theme\wp-content\themes\sage-theme
λ php vendor\bin\sage.bat preset
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../roots/sage-installer/bin/sage
php "%BIN_TARGET%" %*
mmirus commented 5 years ago

Back when I was using Cygwin, this is how I ran these commands: https://discourse.roots.io/t/no-option-prompts-for-composer-sage-install-on-windows/11339/3?u=mmirus

That syntax or some of the others in the thread may help. Let us know on Discourse if not - that's a better place than GitHub for support requests. Good luck!

pixelbrad commented 5 years ago

Ah, you know what, I misread the commands you posted. I had put php in front of my commands (that was from a piece of advice I read somewhere else).

Running the commands

"vendor/bin/sage.bat" meta
"vendor/bin/sage.bat" config
"vendor/bin/sage.bat" preset

works for me. Thanks for the prompt reply!

If anyone stumbles into this down the road, I'm using a program called Cmder in place of Windows' standard command line program.