Skip to content

Commit

Permalink
fix(misc): axios import breaks when using npx
Browse files Browse the repository at this point in the history
(cherry picked from commit 19018fc)
  • Loading branch information
vsavkin authored and FrozenPandaz committed Nov 28, 2022
1 parent 31326f2 commit c127d65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/create-nx-workspace/bin/ab-testing.ts
@@ -1,4 +1,3 @@
import axios from 'axios';
import { isCI } from './output';

export class PromptMessages {
Expand Down Expand Up @@ -56,7 +55,8 @@ export async function recordStat(opts: {
console.log(`Record stat. Major: ${major}`);
}
if (major < 10 || major > 15) return; // test version, skip it
await axios
const axios = require('axios');
await (axios['default'] ?? axios)
.create({
baseURL: 'https://cloud.nx.app',
timeout: 400,
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/utils/ab-testing.ts
@@ -1,4 +1,3 @@
import axios from 'axios';
import { isCI } from './is-ci';

export class PromptMessages {
Expand Down Expand Up @@ -56,7 +55,8 @@ export async function recordStat(opts: {
console.log(`Record stat. Major: ${major}`);
}
if (major < 10 || major > 15) return; // test version, skip it
await axios
const axios = require('axios');
await (axios['default'] ?? axios)
.create({
baseURL: 'https://cloud.nx.app',
timeout: 400,
Expand Down

0 comments on commit c127d65

Please sign in to comment.