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
[TIMOB-24591] Use package-lock.json instead of checking in node_modules #9048
Conversation
I'm cool with this. FR'd just fine.
|
We had already migrated dependencies to use Yeah, I noticed when I ran a It sounds like we need a I think it does raise an interesting issue we haven't really dealt with before, which is that we build for osx/linux/windows but don't filter the node_modules for the target OS. I had to hack around that with windowslib by removing the os restriction or yarn wouldn't grab it. Sounds like maybe ioslib/node-ios-device should be optional darwin-only dependencies, windowslib should be optional windows-only - but then how do we handle this on the full build? I can tweak the Jenkinsfile to build on each target OS separately - whereas now it actually runs on OS X and builds each target OS zip (with all the node_modules!). |
I was thinking we would put the
We should add a |
On a side note, I have a similar problem with the daemon, so it would be a good idea to have a meeting about how to handle platform-specific native Node addons. |
build/packager.js
Outdated
@@ -236,10 +236,22 @@ Packager.prototype.package = function (next) { | |||
cb(); | |||
}); | |||
}.bind(this), | |||
// Download all the pre-built node-ios-device binaries! | |||
unction (cb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unction
? :)
There's an issue with node-pre-gyp and npm5: mapbox/node-pre-gyp#298 |
Turns out it's an npm5 bug: npm/npm#16926 |
So there's an npm5 bug with generating |
Updated the commits to clean up the noise, cherry-picked the changes from #9122 for ioslib 1.4.2 |
… sure we install/use npm5
Note that this PR now contains the same change as #9228 (bumping to windowslib 0.5.2) |
JIRA: https://jira.appcelerator.org/browse/TIMOB-24591
Description:
This migrates us from using npm to manage node_modules dependencies with a checked-in node_modules folder containing production dependencies - to using npm 5+ and a package-lock.json file to set the dependency list to use.
Why?
How does this affect me?
npm install -g npm@latest
node_modules
folder exists and has your production dependencies, you'll need to runnpm install
at the the root of the repo when switching branches. In most cases we don't update dependencies too often, so you could conceivably forget to do this all the time. This is analogous to runningnpm install
when you need to do a local scons/build.npm install
and you don't have network access, you could be left with a working copy of the SDK you can't build/test. npm does use a local cache, so if no dependencies have changed and you don't have network access and have blown away your node_modules folder, you could re-run install and have it work.