From 2e2cb6df227aef83285e627bada59320606674da Mon Sep 17 00:00:00 2001 From: Tatamo Date: Fri, 31 Aug 2018 21:19:52 +0900 Subject: [PATCH] Enable `docker-compose exec workspace npm` (and yarn, etc.) (#1743) * fix node PATH to enable docker-compose exec workspace npm * add PATH for yarn to enable docker-compose exec workspace yarn --- workspace/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 37f1fb1..dd22fef 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -448,6 +448,7 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ && if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \ npm install -g @vue/cli \ ;fi \ + && ln -s `npm bin --global` /home/laradock/.node-bin \ ;fi # Wouldn't execute when added to the RUN statement in the above block @@ -468,7 +469,7 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ ;fi # Add PATH for node -ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin +ENV PATH $PATH:/home/laradock/.node-bin RUN if [ ${NPM_REGISTRY} ]; then \ . ~/.bashrc && npm config set registry ${NPM_REGISTRY} \ @@ -504,6 +505,9 @@ RUN if [ ${INSTALL_YARN} = true ]; then \ echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \ ;fi +# Add PATH for YARN +ENV PATH $PATH:/home/laradock/.yarn/bin + ########################################################################### # PHP Aerospike: ###########################################################################