nest-cli icon indicating copy to clipboard operation
nest-cli copied to clipboard

nest new crashes when installing dependencies

Open raqbit opened this issue 8 years ago • 6 comments

This happens when picking either npm or yarn.

As I would think this is a system dependent issue, here are some details:

Nestjs-cli version: 5.1.2 installed via yarn. Node version: v8.11.2 installed via NVM. NPM version: v5.6.0 installed via NVM. Yarn version: v1.6.0 installed as package via NPM.

OS: Ubuntu 18.04, linux

Simply running nest new [name] and hitting enter for all the questions triggers this crash.

? Which package manager would you ❤️  to use? yarn
▹▹▹▹▹ Take ☕️  or 🍺  during the packages installation process and enjoy your timeevents.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn /bin/sh ENOENT
    at _errnoException (util.js:992:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

raqbit avatar May 22 '18 13:05 raqbit

I assume this is somehow related to this "issue", and the culprit is this line. I was able to reproduce it removing the newly-created folder before this line is executed.

However, I have no clue why the project folder would not exist. I'm running Debian 9 here and I didn't experience this issue.

VinceOPS avatar May 26 '18 22:05 VinceOPS

Hey guys ! After researches I found this https://github.com/nodejs/node/issues/11520 It could be linked to the issue 😢

thomrick avatar May 29 '18 19:05 thomrick

@Raqbit What was the project name you were trying to generate (or something similar)?

@ThomRick I think you were right about the above mentioned issue with non kebab-case naming.

nest new test and nest new test-two works

nest new testTwo fails because it creates the directory test-two but expects the directory to be testTwo, which would explain the directory not being created.

image

josiahdahl avatar Jun 04 '18 18:06 josiahdahl

No links between simple / kebab / camel case app name and the error. The cli transforms the app name to be always in kebab case before calling the nest schematic collection. You can type app name / app-name / App Name / appName / AppName the result will always be app-name.

thomrick avatar Jun 04 '18 18:06 thomrick

@ThomRick I did some debugging and the non-dasherized directory/project name was being passed to the install method in new.action.ts (see right after the package manager selection).

A fix is here https://github.com/nestjs/nest-cli/pull/151

image

josiahdahl avatar Jun 04 '18 20:06 josiahdahl

@josiahdahl Yes, I can confirm that the project was probably NestTest.

raqbit avatar Jun 08 '18 09:06 raqbit