Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 8139246

Browse files
authored
Merge pull request #111 from netlify/fixNpmRunBug
fix npm run bug with execa
2 parents 9f60b3d + 99fd771 commit 8139246

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/commands/dev/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ function startDevServer(settings, log, error) {
156156
return;
157157
}
158158
log(`${NETLIFYDEVLOG} Starting Netlify Dev with ${settings.type}`);
159-
const ps = execa(settings.command, settings.args, {
159+
const args =
160+
settings.command === "npm" ? ["run", ...settings.args] : settings.args;
161+
const ps = execa(settings.command, args, {
160162
env: settings.env,
161163
stdio: "inherit"
162164
});
@@ -167,7 +169,7 @@ function startDevServer(settings, log, error) {
167169

168170
class DevCommand extends Command {
169171
async run() {
170-
this.log(`${NETLIFYDEV} Starting...`);
172+
this.log(`${NETLIFYDEV}`);
171173
let { flags } = this.parse(DevCommand);
172174
const { api, site, config } = this.netlify;
173175
const functionsDir =

src/detectors/utils/jsdetect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function getYarnOrNPMCommand() {
2525
if (!yarnExists) {
2626
yarnExists = existsSync("yarn.lock") ? "yes" : "no";
2727
}
28-
return yarnExists === "yes" ? "yarn" : "npm run";
28+
return yarnExists === "yes" ? "yarn" : "npm";
2929
}
3030

3131
/**

0 commit comments

Comments
 (0)