GSA / https

The HTTPS-Only Standard for federal domains (M-15-13), and implementation guidance.
https://https.cio.gov
Other
248 stars 87 forks source link

Update node version #262

Closed gbinal closed 3 years ago

gbinal commented 3 years ago

As part of the switch to federalist, we're being told to ensure a few updates. One is to update node, preferably to v12.

There'll likely be more of these, but am starting here.

gbinal commented 3 years ago

I'm going to use a branch to do this, as I 100% expect to break the site.

konklone commented 3 years ago

See https://github.com/GSA/https/pull/263 for a possible solution.

gbinal commented 3 years ago

Reviewing now. Thank you for the open source contribution!

gbinal commented 3 years ago

Durn. I'm getting an error when trying to build in federalist.

2021-03-12 15:29:38 INFO [main] Running build for gsa/https/test-build
2021-03-12 15:29:38 INFO [clone] Cloning into '/work/site_repo'...
2021-03-12 15:29:39 INFO [clone] Fetching commit details ...
2021-03-12 15:29:39 INFO [clone] commit 8f37fa4b8aa4ea72efc278b96609baf5285aa5d2
2021-03-12 15:29:39 INFO [setup-node] Checking node version specified in .nvmrc
2021-03-12 15:29:39 INFO [setup-node] Now using node v12.20.1 (npm v6.14.10)
2021-03-12 15:29:40 INFO [setup-node] Unsupported node major version '6' specified in .nvmrc.
2021-03-12 15:29:40 INFO [setup-node] Please upgrade to LTS major version 12 or 14, see https://nodejs.org/en/about/releases/ for details.
2021-03-12 15:29:40 ERROR [main] There was a problem setting up Node, see the above logs for details.

It's pointing here as the problem. Looking at this relevant documentation from federalist, I'm inclined to try emptying that file, or deleting it (the former, I assume is best).

gbinal commented 3 years ago

No luck. Here's the latest error report.

2021-03-12 15:45:03 INFO [main] Running build for gsa/https/test-build
2021-03-12 15:45:03 INFO [clone] Cloning into '/work/site_repo'...
2021-03-12 15:45:05 INFO [clone] Fetching commit details ...
2021-03-12 15:45:05 INFO [clone] commit 4279ccdc1d33f05dc3c5e89af71eed0c258f38f7
2021-03-12 15:45:05 INFO [setup-node] Checking node version specified in .nvmrc
2021-03-12 15:45:05 INFO [setup-node] Now using node v12.20.1 (npm v6.14.10)
2021-03-12 15:45:06 INFO [setup-node] Unsupported node major version '15' specified in .nvmrc.
2021-03-12 15:45:06 INFO [setup-node] Please upgrade to LTS major version 12 or 14, see https://nodejs.org/en/about/releases/ for details.
2021-03-12 15:45:06 ERROR [main] There was a problem setting up Node, see the above logs for details.

Trying none in the .nvmrc file now.

gbinal commented 3 years ago

I'm close but no luck yet.

Error logs:

2021-03-12 15:48:33 INFO [main] Running build for gsa/https/test-build
2021-03-12 15:48:33 INFO [clone] Cloning into '/work/site_repo'...
2021-03-12 15:48:34 INFO [clone] Fetching commit details ...
2021-03-12 15:48:34 INFO [clone] commit ab1d1028a121a23bd994ddd1b694fdd0c1e00896
2021-03-12 15:48:34 INFO [setup-node] Checking node version specified in .nvmrc
2021-03-12 15:48:34 INFO [setup-node] Now using node v12.20.1 (npm v6.14.10)
2021-03-12 15:48:35 INFO [setup-node] Unsupported node major version 'N/A' specified in .nvmrc.
2021-03-12 15:48:35 INFO [setup-node] Please upgrade to LTS major version 12 or 14, see https://nodejs.org/en/about/releases/ for details.
2021-03-12 15:48:35 ERROR [main] There was a problem setting up Node, see the above logs for details.

Now trying 12 in .nvmrc.

gbinal commented 3 years ago

Well, that changed a lot. Looking at ...

2021-03-12 15:50:02 INFO [main] Running build for gsa/https/test-build
2021-03-12 15:50:02 INFO [clone] Cloning into '/work/site_repo'...
2021-03-12 15:50:03 INFO [clone] Fetching commit details ...
2021-03-12 15:50:03 INFO [clone] commit 19a76d203c7eded0c41cdfa343e1925a55fdb6d1
2021-03-12 15:50:03 INFO [setup-node] Checking node version specified in .nvmrc
2021-03-12 15:50:04 INFO [setup-node] Now using node v12.20.1 (npm v6.14.10)
2021-03-12 15:50:05 INFO [setup-node] Switching to node version v12.21.0 specified in .nvmrc
2021-03-12 15:50:05 INFO [setup-node] Downloading and installing node v12.21.0...
2021-03-12 15:50:05 INFO [setup-node] Downloading https://nodejs.org/dist/v12.21.0/node-v12.21.0-linux-x64.tar.xz...
2021-03-12 15:50:05 INFO [setup-node] ######                                                                     8.7%
2021-03-12 15:50:05 INFO [setup-node] ######################################################################## 100.0%
2021-03-12 15:50:05 INFO [setup-node] Computing checksum with sha256sum
2021-03-12 15:50:05 INFO [setup-node] Checksums matched!
2021-03-12 15:50:07 INFO [setup-node] Now using node v12.21.0 (npm v6.14.11)
2021-03-12 15:50:07 INFO [setup-node] default -> v12.21.0 *
2021-03-12 15:50:07 INFO [setup-node] Installing production dependencies in package.json
2021-03-12 15:50:08 INFO [setup-node] Now using node v12.21.0 (npm v6.14.11)
2021-03-12 15:50:08 INFO [setup-node] Now using node v12.21.0 (npm v6.14.11)
2021-03-12 15:50:14 INFO [setup-node] > fsevents@1.2.13 install /work/site_repo/node_modules/fsevents
2021-03-12 15:50:14 INFO [setup-node] > node install.js
2021-03-12 15:50:14 INFO [setup-node] Skipping 'fsevents' build as platform linux is not supported
2021-03-12 15:50:15 INFO [setup-node] > node-sass@4.14.1 install /work/site_repo/node_modules/node-sass
2021-03-12 15:50:15 INFO [setup-node] > node scripts/install.js
2021-03-12 15:50:15 INFO [setup-node] Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-72_binding.node
2021-03-12 15:50:15 INFO [setup-node] Download complete
2021-03-12 15:50:15 INFO [setup-node] Binary saved to /work/site_repo/node_modules/node-sass/vendor/linux-x64-72/binding.node
2021-03-12 15:50:15 INFO [setup-node] Caching binary to /root/.npm/_cacache/node-sass/4.14.1/linux-x64-72_binding.node
2021-03-12 15:50:15 INFO [setup-node] > node-sass@4.14.1 postinstall /work/site_repo/node_modules/node-sass
2021-03-12 15:50:15 INFO [setup-node] > node scripts/build.js
2021-03-12 15:50:15 INFO [setup-node] Binary found at /work/site_repo/node_modules/node-sass/vendor/linux-x64-72/binding.node
2021-03-12 15:50:15 INFO [setup-node] Testing binary
2021-03-12 15:50:15 INFO [setup-node] Binary is fine
2021-03-12 15:50:15 INFO [setup-node] added 894 packages in 6.714s
2021-03-12 15:50:15 INFO [run-federalist-script] Running federalist build script in package.json
2021-03-12 15:50:16 INFO [run-federalist-script] Now using node v12.21.0 (npm v6.14.11)
2021-03-12 15:50:16 INFO [run-federalist-script] > @ federalist /work/site_repo
2021-03-12 15:50:16 INFO [run-federalist-script] > npm run build
2021-03-12 15:50:16 INFO [run-federalist-script] > @ build /work/site_repo
2021-03-12 15:50:16 INFO [run-federalist-script] > gulp
2021-03-12 15:50:17 INFO [run-federalist-script] [15:50:17] Using gulpfile /work/site_repo/gulpfile.js
2021-03-12 15:50:17 INFO [run-federalist-script] [15:50:17] Starting 'default'...
2021-03-12 15:50:17 INFO [run-federalist-script] [15:50:17] Starting 'copy-uswds-assets'...
2021-03-12 15:50:17 INFO [run-federalist-script] [15:50:17] Finished 'copy-uswds-assets' after 158 ms
2021-03-12 15:50:17 INFO [run-federalist-script] [15:50:17] Starting 'build-sass'...
2021-03-12 15:50:17 INFO [run-federalist-script] [15:50:17] Finished 'build-sass' after 164 ms
2021-03-12 15:50:17 INFO [run-federalist-script] [15:50:17] Finished 'default' after 324 ms
2021-03-12 15:50:17 INFO [setup-ruby] Ruby version: ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
2021-03-12 15:50:17 INFO [setup-bundler] Gemfile found, setting up bundler
2021-03-12 15:50:21 INFO [setup-bundler] Successfully installed bundler-1.17.3
2021-03-12 15:50:21 INFO [setup-bundler] Parsing documentation for bundler-1.17.3
2021-03-12 15:50:21 INFO [setup-bundler] Installing ri documentation for bundler-1.17.3
2021-03-12 15:50:21 INFO [setup-bundler] Done installing documentation for bundler after 2 seconds
2021-03-12 15:50:21 INFO [setup-bundler] Installing dependencies in Gemfile
2021-03-12 15:50:21 INFO [setup-bundler] /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0/rubygems.rb:284:in `find_spec_for_exe': Could not find 'bundler' (2.2.14) required by your /work/site_repo/Gemfile.lock. (Gem::GemNotFoundException)
2021-03-12 15:50:21 INFO [setup-bundler] To update to the latest version installed on your system, run `bundle update --bundler`.
2021-03-12 15:50:21 ERROR [main] There was a problem setting up Bundler, see the above logs for details.
gbinal commented 3 years ago

Seems like a new issue, now around bundler but I'm going to keep using this issues to resolve.

gbinal commented 3 years ago

Looks like it's referencing https://github.com/GSA/https/blob/master/Gemfile.lock#L65-L66 ...

gbinal commented 3 years ago

I'm going to switch to trying to get the site running locally so I can run the command lines required...

gbinal commented 3 years ago

actually, the kind and generous @h-m-f-t just pinged me. I'm now trying these edits.

gbinal commented 3 years ago

success!!!! Huge thanks to @h-m-f-t and @konklone.

gbinal commented 3 years ago

done