Skip to content

Commit 2e2cb6d

Browse files
Tatamobestlong
authored andcommitted
Enable docker-compose exec workspace npm (and yarn, etc.) (laradock#1743)
* fix node PATH to enable docker-compose exec workspace npm * add PATH for yarn to enable docker-compose exec workspace yarn
1 parent 39469e1 commit 2e2cb6d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

workspace/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
448448
&& if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \
449449
npm install -g @vue/cli \
450450
;fi \
451+
&& ln -s `npm bin --global` /home/laradock/.node-bin \
451452
;fi
452453

453454
# Wouldn't execute when added to the RUN statement in the above block
@@ -468,7 +469,7 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
468469
;fi
469470

470471
# Add PATH for node
471-
ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin
472+
ENV PATH $PATH:/home/laradock/.node-bin
472473

473474
RUN if [ ${NPM_REGISTRY} ]; then \
474475
. ~/.bashrc && npm config set registry ${NPM_REGISTRY} \
@@ -504,6 +505,9 @@ RUN if [ ${INSTALL_YARN} = true ]; then \
504505
echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \
505506
;fi
506507

508+
# Add PATH for YARN
509+
ENV PATH $PATH:/home/laradock/.yarn/bin
510+
507511
###########################################################################
508512
# PHP Aerospike:
509513
###########################################################################

0 commit comments

Comments
 (0)