Skip to content

Commit 80b6c8a

Browse files
authored
Merge pull request atom#23664 from icecream17/revert-npm
Fix npm ENOENT error in install-script-runner-dependencies
2 parents 6cdc47c + ee56b4b commit 80b6c8a

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

apm/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script/bootstrap

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
'use strict'
44

5-
const path = require('path')
65
const CONFIG = require('./config')
76
const childProcess = require('child_process')
87
const cleanDependencies = require('./lib/clean-dependencies')

script/config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = {
5454
homeDirPath,
5555
getApmBinPath,
5656
getNpmBinPath,
57+
getLocalNpmBinPath,
5758
snapshotAuxiliaryData: {}
5859
};
5960

@@ -111,7 +112,11 @@ function getApmBinPath() {
111112
);
112113
}
113114

114-
function getNpmBinPath(external = false) {
115+
function getNpmBinPath() {
116+
return process.platform === 'win32' ? 'npm.cmd' : 'npm';
117+
}
118+
119+
function getLocalNpmBinPath() {
115120
const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm';
116121
const localNpmBinPath = path.resolve(
117122
repositoryRootPath,

script/lib/install-apm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function(ci) {
1212
}
1313
console.log('Installing apm');
1414
childProcess.execFileSync(
15-
CONFIG.getNpmBinPath(),
15+
CONFIG.getLocalNpmBinPath(),
1616
['--global-style', '--loglevel=error', ci ? 'ci' : 'install'],
1717
{ env: process.env, cwd: CONFIG.apmRootPath }
1818
);

script/lib/install-script-dependencies.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ process.env.ELECTRON_CUSTOM_VERSION = CONFIG.appMetadata.electronVersion;
99

1010
module.exports = function(ci) {
1111
console.log('Installing script dependencies');
12-
const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm';
1312
childProcess.execFileSync(
14-
npmBinName,
13+
CONFIG.getNpmBinPath(ci),
1514
['--loglevel=error', ci ? 'ci' : 'install'],
1615
{ env: process.env, cwd: CONFIG.scriptRootPath }
1716
);

0 commit comments

Comments
 (0)