We have defaulted to using npm that installed as part of the script
dependancies. This is to increase predictability on what version of npm
was used to install atom dependencies
"Node 10.12 or newer" has been a hard requirement since this PR:
https://github.com/atom/atom/pull/20879,
due to newer versions of electron-chromedriver and electron-mksnapshot
relying on extract-zip@2 as an indirect dependency.
(extract-zip@2 requires Node 10.12 or newer for its recursive mkdir.
Using extract-zip@2 with Node older than 10.12 results in errors.
That leads to a lack of electron-vendored
chromedriver or mksnapshot binaries where they're supposed to be.
Which in turn causes startup blob creation (via mksnapshot) to fail
toward the end of the Atom build scripts.)
We don't actually support Node older than 10 for successfully
bootstrapping an Atom build, but we should support older Node in the
system requirements checker script so that we can print useful errors,
like ones to tell the user their system's copy of Node is too old!
(It was me that introduced this Node 10.0.0 or above-only syntax
about a year ago... My mistake. It's as good a time as any to fix it!)
This commit enables faster, more-reproducible installs of `apm`,
when bootstrapping/building Atom in `ci` mode.
(with `--ci` or env var `CI` set).
This only affects bootstrapping/building Atom; This should
not make any difference to the built Atom app, or to `apm`'s behavior
as a command-line tool/as a component of Atom.
Details:
As of apm 2.6.2, apm respects a `NO_APM_DEDUPE` env var on Windows.
(It was already supported on Linux and macOS before then.)
When set, this env var disables the deduping
normally performed at the end of apm's postinstall script.
This deduping doesn't work properly when installing apm with `npm ci`,
for unknown reasons. (The deduping algorithm deletes many needed
dependencies, without reconstructing a valid tree.)
Now that `apm` supports `NO_APM_DEDUPE` on all platforms,
we can safely allow installing `apm` with `npm ci`
during the bootstrap script.
Now bootstrapping apm in `ci` mode is faster in two ways:
- `npm ci` is generally faster than `npm install` for clean installs.
- Great for actual automated builds ("CI").
- The `npm dedupe` run is now skipped in `ci` mode.
- The `npm dedupe` was of dubious value in any case
- The `npm dedupe` command was also surprisingly slow
We also benefit from the stronger reproducibility of `npm ci`
compared to `npm install` (guaranteed, version-locked dependencies).
When copying resource from `{repositoryRootPath}/resources/win/*` to `{bundledResourcesPath}/cli/*`, omitted the {repositoryRootPath}.
Co-authored-by: yoonhyung <yoonhyungkim@webida.org>
New feature as of electron-chromedriver >= 9.0.0
and electron-mksnapshot >= 9.0.2:
an environment variable "ELECTRON_CUSTOM_VERSION",
which allows downloading the specified (Electron-vendored)
version of chromedriver and mksnapshot,
irrespective of the versions of electron-chromedriver
or electron-mksnapshot (node modules) used to download them.
We can use the latest electron-chromedriver and electron-mksnapshot
now, if we want. Just set ELECTRON_CUSTOM_VERSION to the right version
(handled automatically based on "electronVersion" in package.json).