Skip to content

Commit

Permalink
fix(playground): revert back create-react-app to npx as there're much…
Browse files Browse the repository at this point in the history
… more problems with global npm
  • Loading branch information
paveltiunov committed May 21, 2019
1 parent 507e088 commit e434939
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/cubejs-server-core/core/DevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ class DevServer {
if (!await fs.pathExists(dashboardAppPath) || this.createReactAppInit) {
if (!this.createReactAppInit) {
this.cubejsServer.event('Dev Server Create Dashboard App');
this.createReactAppInit = executeCommand('npm', ['install', '-g', 'create-react-app'])
.then(() => executeCommand('create-react-app', [dashboardAppPath]));
this.createReactAppInit = executeCommand('npx', ['create-react-app', dashboardAppPath]).catch(e => {
if (e.toString().indexOf('ENOENT') !== -1) {
throw new Error(`npx is not installed. Please update your npm: \`$ npm install -g npm\`.`);
}
throw e;
});
}
await this.createReactAppInit;
this.cubejsServer.event('Dev Server Create Dashboard App Success');
Expand Down

0 comments on commit e434939

Please sign in to comment.