Page MenuHomePhabricator

`composer install` issues on Windows
Closed, ResolvedPublic

Assigned To
Authored By
Albert221
Dec 15 2017, 12:34 AM
Referenced Files
F11835395: image.png
Dec 15 2017, 12:34 AM
F11835427: image.png
Dec 15 2017, 12:34 AM
F11835420: image.png
Dec 15 2017, 12:34 AM

Description

I encountered some errors that were disallowing me to deploy Xtools on my Windows operating system. I'm using git-scm with symlinks installed.

On composer install the npm install --prefix app/Resources gave me following error:

\> npm install --prefix app/Resources/
npm ERR! Unexpected token a in JSON at position 0

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\walbe\AppData\Roaming\npm-cache\_logs\2017-12-14T23_59_14_661
Z-debug.log
Script npm install --prefix app/Resources/ handling the node_scripts event returned
with error code 1

I solved this by calling cd app/Resources and then npm install and command ran without a problem.

image.png (256×599 px, 30 KB)

But then, when running php bin/console assetic:dump I've run across the second problem:

[RuntimeException]
The source file "E:\xtools\app/../web/bootstrap/css/bootstrap.min.css" does no
t exist.

image.png (636×602 px, 85 KB)

It happened because of the fact, that web/bootstrap "symlink" is actually a text file and isn't a symlink. Running this both on Git Bash and PowerShell gave me the above error. I had to rm web/bootstrap and ln -s /e/xtools/vendor/twbs/boostrap/dist web/bootstrap to make it work.

Third problem, actually that could be changed in config but I don't think that sould happen in OOTB node installation anyway.
Running assetic:dump gave me following error (the error message in Polish says "System couldn't find specified directory"):

image.png (566×959 px, 112 KB)

This is due to the fact, that /usr/local/bin/node does not exist in Git Bash, not to say that in PowerShell too. I now know that this can be changed in config_dev.yml, but I think that this is a very poor approach and this should be used by using /usr/bin/env node by default to address almost all systems out of the box, withou excluding some weirdos on Windows (like me).

Event Timeline

MusikAnimal closed this task as Resolved.EditedJun 20 2019, 1:34 AM
MusikAnimal claimed this task.
MusikAnimal moved this task from General / other to Complete on the XTools board.
MusikAnimal subscribed.

We are now using Webpack Encore to manage assets, and there is no longer any configuration on where the Node executable lives.