Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,6 @@ Object {
"nodeBin": "{NODE}",
"nodeVersion": "2.2.2",
"noProxy": "",
"npmBin": "{CWD}/{TESTDIR}/docs.js",
"npmCommand": "version",
"npmVersion": "3.3.3",
"npxCache": "{CWD}/cache/_npx",
Expand Down
4 changes: 0 additions & 4 deletions workspaces/config/lib/definitions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const flatten = (obj, flat = {}) => {
}
}

// XXX make this the bin/npm-cli.js file explicitly instead
// otherwise using npm programmatically is a bit of a pain.
flat.npmBin = require.main ? require.main.filename
: /* istanbul ignore next - not configurable property */ undefined
flat.nodeBin = process.env.NODE || process.execPath

return flat
Expand Down
1 change: 1 addition & 0 deletions workspaces/config/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class Config {
this.defaults = defaults

this.npmPath = npmPath
this.npmBin = join(this.npmPath, 'bin/npm-cli.js')
this.argv = argv
this.env = env
this.execPath = execPath
Expand Down
5 changes: 1 addition & 4 deletions workspaces/config/lib/set-envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ const setEnvs = (config) => {
if (cliConf['node-options']) {
env.NODE_OPTIONS = cliConf['node-options']
}

if (require.main && require.main.filename) {
env.npm_execpath = require.main.filename
}
env.npm_execpath = config.npmBin
env.NODE = env.npm_node_execpath = config.execPath
}

Expand Down