madlabsinc / mevn-cli

Light speed setup for MEVN(Mongo Express Vue Node) Apps
https://mevn.surge.sh
MIT License
825 stars 152 forks source link

mevn init fails on windows #193

Closed Pieter-Uys closed 4 years ago

Pieter-Uys commented 4 years ago

Do you want to request a feature or report a bug?

Think its a bug

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce. If I use mevn init (used my own appname like cookies to test it out) and selected default => single page app => nodejs hosting => server side template (I selected yes)

What is the expected behavior?

If this is a feature request, what is motivation or use case for changing the behavior? To work without outputting an error after mevn init completion

Local Environment Information

Please paste the results of mevn info here.

after I've done mevn init it outputs this error in my command line ` You're all set Now, just type in cd cookies && mevn serve (node:1580) UnhandledPromiseRejectionWarning: Error: Command failed: C:\Windows\system32\cmd.exe /q /s /c "rmdir /s /q cookies.git" The system cannot find the file specified.

at makeError (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\node_modules\execa\index.js:174:9)
at module.exports.sync (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\node_modules\execa\index.js:338:15)
at handleShell (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\node_modules\execa\index.js:117:9)
at Function.module.exports.shellSync (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\node_modules\execa\index.js:361:43)
at showInstructions (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\lib\commands\basic\init.js:71:21)    at _callee$ (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\lib\commands\basic\init.js:210:13)
at tryCatch (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\node_modules\regenerator-runtime\runtime.js:63:40)
at Generator.invoke [as _invoke] (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\node_modules\regenerator-runtime\runtime.js:293:22)
at Generator.next (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\node_modules\regenerator-runtime\runtime.js:118:21)
at asyncGeneratorStep (C:\Users\PC\AppData\Roaming\npm\node_modules\mevn-cli\lib\commands\basic\init.js:27:103)

(node:1580) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:1580) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. `

Screenshots

If applicable, add screenshots to help explain your problem. Nope sorry Additional context Nope sorry

welcome[bot] commented 4 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

jamesgeorge007 commented 4 years ago

init.js

diff --git a/src/commands/basic/init.js b/src/commands/basic/init.js
index 3ac33b8..5432bc1 100644
--- a/src/commands/basic/init.js
+++ b/src/commands/basic/init.js
@@ -57,8 +57,6 @@ const showInstructions = () => {
   console.log(chalk.cyan.bold(`You're all set`));
   console.log(chalk.cyan.bold(`Now, just type in ${userCommandInstruction}`));

-  let removeCmd = isWin ? 'rmdir /s /q' : 'rm -rf';
-  execa.commandSync(`${removeCmd} ${path.join(projectPathRelative, '.git')}`);
   makeInitialCommit();
 };

Feel free to send a fix.