Skip to content

Instantly share code, notes, and snippets.

@RecuencoJones
Created November 10, 2017 09:07
Show Gist options
  • Save RecuencoJones/38c885bf0788868623fd38ff327f11b0 to your computer and use it in GitHub Desktop.
Save RecuencoJones/38c885bf0788868623fd38ff327f11b0 to your computer and use it in GitHub Desktop.
npm@4 file dependency resolutions
FROM node:7
COPY package-a.json /test/package-a/package.json
COPY package-b.json /test/package-b/package.json
COPY entrypoint.sh /test/entrypoint.sh
ENTRYPOINT ["/test/entrypoint.sh"]
#!/bin/bash
cd /test/package-a
npm install
cd /test/package-b
npm install
# list some dependencies for comparison
echo "--> package-a/node_modules/"
ls -al /test/package-a/node_modules | head -n 10
echo "---> package-b/node_modules/"
ls -al /test/package-b/node_modules | head -n 10
tail -f /dev/null
{
"name": "package-a",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"webpack": "3.8.1"
}
}
{
"name": "package-b",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"package-a": "file:../package-a"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment