{"id":885,"date":"2018-01-26T11:31:28","date_gmt":"2018-01-26T10:31:28","guid":{"rendered":"http:\/\/blog.via-internet.de\/?p=885"},"modified":"2025-04-17T14:08:28","modified_gmt":"2025-04-17T12:08:28","slug":"build-separated-development-environments-with-direnv","status":"publish","type":"post","link":"https:\/\/via-internet.de\/blog\/2018\/01\/26\/build-separated-development-environments-with-direnv\/","title":{"rendered":"Build separated development environments with direnv"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">TL;DR<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Working with Ionic sometimes means to handle different versions of Ionic\/Cordova and Ionic\/Cordova Plugins.&nbsp;My goal was, to setup an Ionic environment specify for each project. And I want do activate the environments automatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I started with <a href=\"https:\/\/github.com\/kennethreitz\/autoenv\">autoenv<\/a>, but unfortunately there is no unload\/deactivate mechanism. So, finally, i switched to&nbsp;<a href=\"https:\/\/direnv.net\/\">direnv<\/a>. But i also tried different solutions with Vagrant or Docker.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Requirements<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You will need a package manager to install the different software packages. There are a variety of package manager for the different platforms.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For macOS, i will use <a href=\"https:\/\/brew.sh\/index_de.html\" target=\"_blank\" rel=\"noopener\">Homebrew<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Things about my directory structure<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Mostly, i try to group files in different directories, depending on their functionality.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Environment files goes to a directory <span style=\"font-family: 'courier new', courier, monospace;\">.env<\/span>. But, wait: there could be more environments (node.js, ruby, python), which all could be used in my project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, i decide to use subfolders for each possible environment. Here it looks like:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ tree myproject\nmyproject\n\u2514\u2500\u2500 .env\n    \u251c\u2500\u2500 nvm\n    \u251c\u2500\u2500 pyenv\n    \u2514\u2500\u2500 ruby<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"simpleexample\"><\/a>Some small example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Suppose, you have this directory structure<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.\n\u251c\u2500\u2500 home\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 .envrc\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 bath\n\u2502\u00a0\u00a0     \u2514\u2500\u2500 .envrc\n\u2514\u2500\u2500 office\n    \u2514\u2500\u2500 .envrc<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you <em>walk<\/em>&nbsp;between this different rooms, you will see how <span style=\"font-family: 'courier new', courier, monospace;\">direnv<\/span> follow you<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"3,6,9,14,17\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">~\/tmp$ cd home\ndirenv: loading .envrc\nYou are at home\n~\/tmp\/home$ cd bath\ndirenv: loading .envrc\nYou are in the bath\n~\/tmp\/home\/bath$ cd ..\ndirenv: loading .envrc\nYou are at home\n~\/tmp\/home$ cd ..\ndirenv: unloading\n~\/tmp$ cd office\ndirenv: loading .envrc\nYou are at work\n~\/tmp\/office$ cd ..\/home\/bath\ndirenv: loading .envrc\nYou are in the bath\n~\/tmp\/home\/bath$<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There is a detailed installation instruction <a href=\"https:\/\/direnv.net\/\">here<\/a>, but for macOS, here is the simple step<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ brew install direnv\n==> Downloading https:\/\/homebrew.bintray.com\/bottles\/direnv-2.14.0.high_sierra.bottle.tar.gz\nAlready downloaded: \/home\/user\/Library\/Caches\/Homebrew\/direnv-2.14.0.high_sierra.bottle.tar.gz\n==> Pouring direnv-2.14.0.high_sierra.bottle.tar.gz\n  \/usr\/local\/Cellar\/direnv\/2.14.0: 8 files, 3.7MB\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, check if installation has succeed<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ direnv version\n2.14.0<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Directory specific configuration is made through the file <span style=\"font-family: 'courier new', courier, monospace;\">.envrc<\/span>.&nbsp;It&#8217;s like a normal Shell profile script, so mostly all commands are allowed and possible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Entering the directory triggers this configuration file, so a normal <span style=\"font-family: 'courier new', courier, monospace;\">cd<\/span> into the directory does the environment setup.. <strong>pretty cool<\/strong>!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my <a href=\"#simpleexample\" class=\"ek-link\">simple example<\/a>, i used this configuration files<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"6-8\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">~\/tmp$ find . -name .envrc\n.\/home\/.envrc\n.\/home\/bath\/.envrc\n.\/office\/.envrc\n~\/tmp$ find . -name .envrc -exec cat {} \\;\necho \"You are at home\"\necho \"You are in the bath\"\necho \"You are at work\"<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Setting up a sample project<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Ionic heavily depends on <a href=\"https:\/\/nodejs.org\" target=\"_blank\" rel=\"noopener\">node.js<\/a> So, the challenge is to setup different node.js environments. Luckily, there is already a solution for that: <a href=\"https:\/\/github.com\/creationix\/nvm\" target=\"_blank\" rel=\"noopener\">Node Version Manager nvm<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install nvm<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For macOS, this is quit simple (details could be found <a href=\"https:\/\/github.com\/creationix\/nvm#installation\" target=\"_blank\" rel=\"noopener\">here<\/a>)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ brew install nvm<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or, manually<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ wget -qO- https:\/\/raw.githubusercontent.com\/creationix\/nvm\/v0.33.8\/install.sh | bash<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Setup directory structure<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create the desired directory structure<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ cd $HOME\/tmp\n$ mkdir -p myproject2\/.env\/nvm\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure direnv<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following lines (with some additional lines) into your direnv configuration file <span style=\"font-family: 'courier new', courier, monospace;\">.envrc<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/bash\n\nexport NVM_DIR=$HOME\/tmp\/.env\/nvm\n\necho setup nvm with NVM_DIR=$NVM_DIR\n. \/usr\/local\/opt\/nvm\/nvm.sh\n\nnvm --version<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Hint:<\/strong> When you created the file (for example with vi), you get the error message, that the <span style=\"font-family: 'courier new', courier, monospace;\">.envrc<\/span> file is blocked<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ vi .envrc\ndirenv: error .envrc is blocked. Run `direnv allow` to approve its content.<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the suggested solution: run <span style=\"font-family: 'courier new', courier, monospace;\">direnv allow<\/span><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ direnv allow\ndirenv: loading .envrc\nsetup nvm with NVM_DIR=\/home\/user\/tmp\/myproject\/.env\/nvm\n0.33.8\ndirenv: export +NVM_CD_FLAGS +NVM_DIR +NVM_RC_VERSION<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, test the configuration: Leave the directory and enter it again<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ cd ..\ndirenv: unloading\n$ cd myproject\ndirenv: loading .envrc\nsetup nvm with NVM_DIR=\/home\/user\/tmp\/myproject\/.env\/nvm\n0.33.8\ndirenv: export +NVM_CD_FLAGS +NVM_DIR +NVM_RC_VERSION<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Hint: <\/strong>If this does not work, try to start the configuration file manually for the first time,&nbsp;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ cd $HOME\/tmp\/myproject\n$ . .envrc\nsetup nvm with NVM_DIR=\/home\/user\/tmp\/myproject\/.env\/nvm\n0.33.8<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fix possibile warnings and errors<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you get this error message<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">nvm is not compatible with the npm config \"prefix\" option: currently set to ...<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, issue this command<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ npm config delete prefix<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install node<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now, the real task: install node.js<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"6\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ cd $HOME\/tmp\/myproject\n$ nvm --version\n0.33.8\n$ node --version\n-bash: node: command not found\n$ nvm install 9.4.0\nDownloading and installing node v9.4.0...\nDownloading https:\/\/nodejs.org\/dist\/v9.4.0\/node-v9.4.0-darwin-x64.tar.xz...\n######################################################################## 100,0\nComputing checksum with shasum -a 256\nChecksums matched!\nNow using node v9.4.0 (npm v5.6.0)\nCreating default alias: default -> 9.4.0 (-> v9.4.0)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Test the installation<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1,3\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ which node\n\/home\/user\/tmp\/myproject\/.env\/nvm\/versions\/node\/v9.4.0\/bin\/node\n$ node --version\nv9.4.0<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to use an additional node version (maybe the latest LTS version), just install it<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ nvm install lts\/carbon\nDownloading and installing node v8.9.4...\nDownloading https:\/\/nodejs.org\/dist\/v8.9.4\/node-v8.9.4-darwin-x64.tar.xz...\n######################################################################## 100,0\nComputing checksum with shasum -a 256\nChecksums matched!\nNow using node v8.9.4 (npm v5.6.0)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can switch between the different versions with nvm use<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ nvm use lts\/carbon\nNow using node v8.9.4 (npm v5.6.0)\n$ node --version; npm --version\nv8.9.4\n5.6.0\n$ nvm use default\nNow using node v9.4.0 (npm v5.6.0)\n$ node --version; npm --version\nv9.4.0\n5.6.0<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Setting up Ionic Environment<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">After this required preparation, we can start setting up our Ionic Environment<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"tw-target-text\"><span lang=\"en\">For this example, I choose the following start path:&nbsp;<strong><span style=\"font-family: 'courier new', courier, monospace;\">~\/Workspace\/Ionic3<\/span><\/strong><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Setup_directory_structure\">Setup directory structure<\/span><\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ mkdir -p $HOME\/Workspace\/Ionic3\/.env\/nvm\n$ cd $HOME\/Workspace\/Ionic3\n$ vi .envrc<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create the direnv configuration file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Configuration file<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/bash\n#-------------------------------------------------------------------------------\n#\n#-------------------------------------------------------------------------------\n  HERE=\"$PWD\"\n\n#-------------------------------------------------------------------------------\n#\n#-------------------------------------------------------------------------------\n  _USE_NODE_VERSION=9.4.0\n\n#-------------------------------------------------------------------------------\n#\n#-------------------------------------------------------------------------------\n  export NVM_DIR=\"$HERE\/.env\/nvm\"\n\n  echo \"setup nvm: $NVM_DIR\"\n  . \/usr\/local\/opt\/nvm\/nvm.sh\n\n  nvm use $_USE_NODE_VERSION --silent\n\n  echo \"enabled nvm :  $(nvm  --version) $(which nvm  | sed 's#'$NVM_DIR'\/##')\"\n  echo \"enabled node:  $(node --version) $(which node | sed 's#'$NVM_DIR'\/##')\"\n  echo \"enabled npm :  $(npm  --version) $(which npm  | sed 's#'$NVM_DIR'\/##')\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Allow the configuration file for use<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ direnv allow\ndirenv: loading .envrc\nsetup nvm: \/home\/user\/Workspace\/Ionic3\/.env\/nvm\nenabled nvm : 0.33.8\nenabled node: v9.4.0 versions\/node\/v9.4.0\/bin\/node\nenabled npm : 5.6.0 versions\/node\/v9.4.0\/bin\/npm\ndirenv: export +NVM_CD_FLAGS +NVM_DIR<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Test the configuration<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">~$ cd\n~$ cd Workspace\/Ionic3\ndirenv: loading .envrc\nsetup nvm: \/home\/user\/Workspace\/Ionic3\/.env\/nvm\nenabled nvm :  0.33.8\nenabled node:  v9.4.0 versions\/node\/v9.4.0\/bin\/node\nenabled npm :  5.6.0 versions\/node\/v9.4.0\/bin\/npm\ndirenv: export +NVM_CD_FLAGS +NVM_DIR<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Well done!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setup Ionic<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Install required parts<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ npm -g install ionic@latest cordova@latest<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Test your installation<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">~\/Workspace\/Ionic3$ ionic --version\n3.19.1\n~\/Workspace\/Ionic3$ cordova --version\n8.0.0\n~\/Workspace\/Ionic3$ $ which ionic\n\/home\/user\/Workspace\/Ionic3\/.env\/nvm\/versions\/node\/v9.4.0\/bin\/ionic<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And, finally, work with Ionic<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ ionic start super super --cordova --no-link\n$ cd super\n$ ionic serve\n\n<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Next steps<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Happy with this, maybe you want to try <a href=\"http:\/\/blog.via-internet.de\/en\/blog\/category\/mobile-development\/ionic\/\">other<\/a> things.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TL;DR Working with Ionic sometimes means to handle different versions of Ionic\/Cordova and Ionic\/Cordova Plugins.&nbsp;My goal was, to setup an Ionic environment specify for each project. And I want do activate the environments automatically. I started with autoenv, but unfortunately there is no unload\/deactivate mechanism. So, finally, i switched to&nbsp;direnv. But i also tried different solutions with Vagrant or Docker. Requirements You will need a package manager to install the different software packages. There are a variety of package manager for the different platforms.&nbsp; For macOS, i will use Homebrew. Things about my directory structure Mostly, i try to group files [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-885","post","type-post","status-publish","format-standard","hentry","category-generell"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/posts\/885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/comments?post=885"}],"version-history":[{"count":1,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/posts\/885\/revisions"}],"predecessor-version":[{"id":10346,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/posts\/885\/revisions\/10346"}],"wp:attachment":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/media?parent=885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/categories?post=885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/tags?post=885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}