<commit_before>'use strict'

const childProcess = require('child_process')
const fs = require('fs')
const path = require('path')

const CONFIG = require('../config')

module.exports = function () {
  verifyNode()
  verifyNpm()
  if (process.platform === 'win32') {
    verifyPython()
  }
}

function verifyNode () {
  const fullVersion = process.versions.node
  const majorVersion = fullVersion.split('.')[0]
  if (majorVersion >= 4 && majorVersion < 7) {
    console.log(`Node:\tv${fullVersion}`)
  } else if (majorVersion >= 7) {
    throw new Error(`Atom does not build properly on node v7+. node v${fullVersion} is installed.`)
  } else {
    throw new Error(`node v4+ is required to build Atom. node v${fullVersion} is installed.`)
  }
}

function verifyNpm () {
  const stdout = childProcess.execFileSync(CONFIG.getNpmBinPath(), ['--version'], {env: process.env})
  const fullVersion = stdout.toString().trim()
  const majorVersion = fullVersion.split('.')[0]
  if (majorVersion >= 3) {
    console.log(`Npm:\tv${fullVersion}`)
  } else {
    throw new Error(`npm v3+ is required to build Atom. npm v${fullVersion} was detected.`)
  }
}

function verifyPython () {<commit_msg>Allow Atom to build on Node 7+<commit_after>'use strict'

const childProcess = require('child_process')
const fs = require('fs')
const path = require('path')

const CONFIG = require('../config')

module.exports = function () {
  verifyNode()
  verifyNpm()
  if (process.platform === 'win32') {
    verifyPython()
  }
}

function verifyNode () {
  const fullVersion = process.versions.node
  const majorVersion = fullVersion.split('.')[0]
  if (majorVersion >= 4) {
    console.log(`Node:\tv${fullVersion}`)
  } else {
    throw new Error(`node v4+ is required to build Atom. node v${fullVersion} is installed.`)
  }
}

function verifyNpm () {
  const stdout = childProcess.execFileSync(CONFIG.getNpmBinPath(), ['--version'], {env: process.env})
  const fullVersion = stdout.toString().trim()
  const majorVersion = fullVersion.split('.')[0]
  if (majorVersion >= 3) {
    console.log(`Npm:\tv${fullVersion}`)
  } else {
    throw new Error(`npm v3+ is required to build Atom. npm v${fullVersion} was detected.`)
  }
}

function verifyPython () {
{'fraction_non_alphanumeric': 0.15626403233048944, 'fraction_numerical': 0.00898069151324652, 'mean_word_length': 4.1336405529953915, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7577189', 'n_tokens_mistral': 717, 'n_tokens_neox': 698, 'n_words': 190}