create-server-nodejs 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/packages/index.js +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-server-nodejs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "server.js",
6
6
  "scripts": {
package/packages/index.js CHANGED
@@ -126,6 +126,22 @@ Object.keys(files).forEach(fileName => {
126
126
  console.log(chalk.green(`File created: ${fileName}`));
127
127
  });
128
128
 
129
+ // ==================== npm install ====================
130
+
131
+ console.log(chalk.yellow('\nšŸ“¦ Installing dependencies... (This may take a while)'));
132
+ try {
133
+ execSync('npm install', {
134
+ cwd: targetDir,
135
+ stdio: 'inherit'
136
+ });
137
+ console.log(chalk.green('āœ… Dependencies installed successfully!'));
138
+ } catch (error) {
139
+ console.log(chalk.red('āŒ Error during npm install:'));
140
+ console.error(error.message);
141
+ }
142
+
143
+ // ============================================================
144
+
129
145
  console.log(chalk.bold.green('\n Project created successfully!'));
130
146
  console.log(chalk.cyan(`\n cd ${projectName}`));
131
147
  console.log(chalk.cyan(` npm install`));