|
| 1 | +.. _west-troubleshooting: |
| 2 | + |
| 3 | +Troubleshooting West |
| 4 | +#################### |
| 5 | + |
| 6 | +This page covers common issues with west and how to solve them. |
| 7 | + |
| 8 | +"invalid choice: 'post-init'" |
| 9 | +***************************** |
| 10 | + |
| 11 | +If you see this error when running ``west init``: |
| 12 | + |
| 13 | +.. code-block:: none |
| 14 | +
|
| 15 | + west: error: argument <command>: invalid choice: 'post-init' |
| 16 | + (choose from 'init', 'update', 'list', 'manifest', 'diff', |
| 17 | + 'status', 'forall', 'config', 'selfupdate', 'help') |
| 18 | +
|
| 19 | +Then you have an old version of west installed, and are trying to use it in an |
| 20 | +installation that requires a more recent version. |
| 21 | + |
| 22 | +The easiest way to resolve this issue is to upgrade west and retry as follows: |
| 23 | + |
| 24 | +#. Install the latest west with the ``-U`` option for ``pip3 install`` as shown |
| 25 | + in :ref:`west-install`. |
| 26 | + |
| 27 | +#. Back up any contents of :file:`zephyrproject/.west/config` that you want to |
| 28 | + save. (If you don't have any configuration options set, it's safe to skip |
| 29 | + this step.) |
| 30 | + |
| 31 | +#. Completely remove the :file:`zephyrproject/.west` directory (if you don't, |
| 32 | + you will get the "already in an installation" error message discussed next). |
| 33 | + |
| 34 | +#. Run ``west init`` again. |
| 35 | + |
| 36 | +"already in an installation" |
| 37 | +**************************** |
| 38 | + |
| 39 | +You may see this error when running ``west init``: |
| 40 | + |
| 41 | +.. code-block:: none |
| 42 | +
|
| 43 | + FATAL ERROR: already in an installation (<some directory>), aborting |
| 44 | +
|
| 45 | +If this is unexpected and you're really trying to create a new installation, |
| 46 | +then it's likely that west is using the :envvar:`ZEPHYR_BASE` :ref:`environment |
| 47 | +variable <env_vars>` to locate a west installation elsewhere on your system. |
| 48 | +This is intentional behavior; it allows you to put your Zephyr applications in |
| 49 | +any directory and still use west. |
| 50 | + |
| 51 | +To resolve this issue, unset :envvar:`ZEPHYR_BASE` and try again. |
0 commit comments