function getLowestVersion(dependency, range) {
    return new Promise((resolve, reject) => {
        if (range.startsWith('file:')) {
            resolve([dependency, range]);
        }

        childProcess.exec(
            `npm view "${dependency}@${range}" version`,
            { encoding: 'utf-8' },
            (error, stdout) => {
                if (error) {
                    reject(`Could not retrieve versions list for "${dependency}@${range}"`);
                    return;
                }

                const versions = stdout
                    .split('\n')
                    .filter(line => line);

                if (versions.length === 0) {
                    reject(`Could not find a lowest version for "${dependency}@${range}"`);
                    return;
                }

                const parts = versions[0].split(' ');

                // If there is only one version available that version
                // is directly printed as the output of npm view.
                if (parts.length === 1) {
                    resolve([dependency, parts[0]]);
                    return;
                }

                // If multiple versions are available then it outputs
                // multiple lines matching the following format:
                // <package>@<version> '<version>'
                if (parts.length === 2) {
                    resolve([dependency, parts[1].replace(/'/g, '')]);
                    return;
                }

                reject(`Unexpected response for "${dependency}@${range}": ${versions[0]}`);
            }
        );
    });
}
@param {string} dependency
@param {string} range
@return {Promise}