Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nest new crashes when installing dependencies #138

Closed
raqbit opened this issue May 22, 2018 · 6 comments · Fixed by #157
Closed

nest new crashes when installing dependencies #138

raqbit opened this issue May 22, 2018 · 6 comments · Fixed by #157
Labels

Comments

@raqbit
Copy link

raqbit commented May 22, 2018

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)
@thomrick thomrick added the bug label May 25, 2018
@VinceOPS
Copy link
Contributor

VinceOPS commented May 26, 2018

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.

@thomrick
Copy link
Contributor

Hey guys !
After researches I found this nodejs/node#11520
It could be linked to the issue 😢

@josiahdahl
Copy link
Contributor

@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

@thomrick
Copy link
Contributor

thomrick commented Jun 4, 2018

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.

@josiahdahl
Copy link
Contributor

@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 #151

image

@raqbit
Copy link
Author

raqbit commented Jun 8, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants