Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install uses wrong package #17

Closed
itajaja opened this issue May 6, 2015 · 4 comments
Closed

npm install uses wrong package #17

itajaja opened this issue May 6, 2015 · 4 comments

Comments

@itajaja
Copy link

itajaja commented May 6, 2015

I have the following weird combination that leads to unexpected results.

I am running docker on Windows, and in my package.json there is a dependency to phantomjs which install a different executable depending on the environment is in: if it's on windows it downloads a windows executable, if it's on linux it downloads a linux executable. Apparently, the npm install command is run in my windows environment, or it caches the windows packages, Since if I enter the docker image bash and I ls into the node_modules phantomjs folder, I see the windows executable. If I do

rm node_modules -r
npm install

inside the docker container bash it installs the correct phantomjs executable. Is it true that the npm install run during docker build depends on the host environment and not the container environment? This could explain why, otherwise could be a caching problem... Can someone shed some light?

@tianon
Copy link
Contributor

tianon commented May 6, 2015 via email

@itajaja
Copy link
Author

itajaja commented May 6, 2015

building with --no-cache=true and dockerignoring the node_modules worked! A question: I thought that in absence of a .dockerignore file, docker would use the .gitignore file. Is that untrue?

@tianon
Copy link
Contributor

tianon commented May 6, 2015 via email

@itajaja
Copy link
Author

itajaja commented May 6, 2015

thanks for the clarification, I might have been confused by something else, maybe by how npm and npmignore work :)

@itajaja itajaja closed this as completed May 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants