Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Install npm as part of docker build #80

Closed
wants to merge 2 commits into from

Conversation

ABaldwinHunter
Copy link
Contributor

@codeclimate/review

Fixes the following error I began seeing locally:

Removing intermediate container 85df8e8d7b2e
Step 14 : RUN npm install
 ---> Running in 1b4d48c42a57
/bin/sh: 1: npm: not found

@ABaldwinHunter
Copy link
Contributor Author

Closing because of circle failures. Investigating why the docker build doesn't work locally without npm, and can't work on circle with it. :(

@ABaldwinHunter
Copy link
Contributor Author

Rebuilt the image locally without cache and that did the trick fwiw.

@@ -9,7 +9,7 @@ COPY vendor/php-parser/composer.json /usr/src/app/vendor/php-parser/
COPY vendor/php-parser/composer.lock /usr/src/app/vendor/php-parser/

RUN curl --silent --location https://deb.nodesource.com/setup_5.x | bash -
RUN apt-get update && apt-get install -y nodejs python openssh-client php5-cli php5-json
RUN apt-get update && apt-get install -y nodejs npm python openssh-client php5-cli php5-json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ABaldwinHunter your issue is because of the dependency between the installation here and the nodesource install a line above. You should combine them to one RUN invocation with && so that they are cached (and invalidated) together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pbrisbin cool, thanks for the explanation!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ABaldwinHunter ABaldwinHunter deleted the abh-add-npm-dockerfile branch January 23, 2016 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants