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

Error: Project creation failed during initiation. #14

Open
alexlafroscia opened this issue Dec 31, 2018 · 16 comments
Open

Error: Project creation failed during initiation. #14

alexlafroscia opened this issue Dec 31, 2018 · 16 comments

Comments

@alexlafroscia
Copy link

I tried to create a new project with the Octane + TS blueprint, but faced the following error:

Could not setup your project: Project creation failed during initiation.

Nothing other than that is reported, so I can't really give any more information that that.

@alexlafroscia
Copy link
Author

I tried both

npx ember-cli-create

And this

yarn global add ember-cli-create
ember-cli-create

but both have the same issue

@gossi
Copy link
Owner

gossi commented Jan 1, 2019

That error appears when the folder couldn't be created during the init step (which runs ember new). I've seen this in only rare cases and the solution was to run it again 😄 - so maybe this can help other than that could maybe be a permission thing. At least ember new fails here.

@alexlafroscia
Copy link
Author

I was trying to make it in my Desktop directory, so I don't think it's a permissions issue. I was able to ember new an application with the same name into the same location.

@gossi
Copy link
Owner

gossi commented Jan 2, 2019

I have no idea why this is failing. All I do is this:

const { config } = context;
const args = [config.cmd, config.name, '--directory', config.directory, '--skip-npm'];
const options = { env: {}};
if (config.packageManager === 'yarn') {
args.push('--yarn');
}
args.push(config.welcome ? '--welcome' : '--no-welcome');
if (config['web-component']) {
args.push(`--web-component=${config['web-component']}`);
}
if (config.blueprint) {
args.push('-b', config.blueprint);
}
for (const experiment of config.experiments) {
options.env[`EMBER_CLI_${experiment}`] = true;
}
// add --skip-git when we are in a workspace
const inWorkspace = await workspace.projectInWorkspace(config.directory);
if (inWorkspace) {
args.push('--skip-git');
}
return exec('ember', args, options);

where config.cmd is either new or addon

@kovalchik
Copy link

I also have this issue. I originally thought it was due to my use of nodenv but I tried using the standard homebrew installed node and received the same error. I'm also trying this in a folder where permissions shouldn't be an issue. Is there any way for us to enable some more robust logging to try to help track down the issue?

@gossi
Copy link
Owner

gossi commented Jan 2, 2019

No, nothing like this is built-in 😬 As you can see, it running ember new|addon command with respective args and options. It is piped through execa.

I have seen this error myself, run the same thing one more time and it runs through. If you have suggestions how to debug this, I'm more than happy to integrate them.

@kovalchik
Copy link

It does look like the execa command should be working. I dug around in the source a bit and couldn't log much the console that would indicate otherwise.

Interestingly, the install does work for me if I have ember-cli installed as a global npm or yarn module. I've used ember-cli-create before and I'm sure I didn't previously need to install ember-cli globally. I see that the package.json doesn't explicitly include ember-cli; perhaps a dependency updated and removed an implicit dependency?

I'll see if I can come up with anything else. For now, installing globally does seem to be a valid workaround for me.

@gossi
Copy link
Owner

gossi commented Jan 3, 2019

Hmm, no - ember-cli-create was never having a dependency to ember-cli itself. That is by design, it will use your globally installed one. Some need to have an explicit version here.

@kovalchik
Copy link

Ah I see; that makes sense. Well, that solves my problem. @alexlafroscia is this also the cause of your issue? Didn't mean to hijack your issue for my user error problems.

@alexlafroscia
Copy link
Author

alexlafroscia commented Jan 4, 2019

I don't have a globally installed Ember executable -- maybe that's the issue? I run everything through npx since global node packages can be problematic sometimes.

If a global ember executable is necessary, maybe there can be a validation for that before running it and a more specific error message provided, so that people know that that's a dependency? I can't find a reference to a global ember executable being necessary anywhere.

Event better, "just working" with npx would be even better -- I think it makes way more sense for tools like this to be used that way so that you always are starting a project with the latest version, rather than having a global version that needs to be updated/maintained considering how infrequently most people use a project bootstrapping tool (not dismiss the usefulness -- it's just only used once per project!)

@gossi
Copy link
Owner

gossi commented Jan 4, 2019

Ah, I was blindly suggesting everybody has a global ember executable. For me npx made the whole situation worse, so I abandonned it right away 😂 (maybe I need to give it another try).

From what I read, there should be a check for the ember executable, may it be globally installed or accessable via npx. In case it is not, there should for now be at least an error.

ember-cli-create could itself have a dependency to ember-cli but since ec-create is supposed to be installed globally, so would ember-cli. However, I recently discoverd, that @mansona has made installing ember possible without ember-cli being installed globally by just using npm. I see this as an alternative. If it takes all the arguments, that ember-cli would take, it should work that way.

Chris: Can you enlight us here? (will it also work with yarn instead of npm?)

@mansona
Copy link

mansona commented Jan 8, 2019

You may want to take a look at what we're doing in https://github.com/ember-cli/create-ember-app

We've recently fixed it in the case where you don't have ember-cli installed globally 👍

@ghost
Copy link

ghost commented Jan 24, 2019

I am seeing this as well with [email protected] in a linux environment that has node installed, but no global ember-cli. I installed ember-cli globally, tried again, but the same error occurs. I am using the fish shell which may affect environment variables or something? @alexlafroscia what kind of environment are you running the command in?

@ghost
Copy link

ghost commented Jan 24, 2019

What name did you use for the project? If i use the string test, it fails each time for me. Using hi causes it to work.

~/Playground> ember-cli-create 
? What kind of ember project you want to create? Octane
  -> MU, Decorators, Sparkles, ...
? What is the name of your project: hi
...
 🐹 Your ember project setup is finished.
 🚀 Change to your project directory and enjoy developing:

    cd hi/

@alexlafroscia
Copy link
Author

I'm on macOS with zsh. I just tried this; still got an error
screen shot 2019-01-25 at 11 04 48 am

@ghost
Copy link

ghost commented Jan 25, 2019

Thanks for testing! For another case, I tried on my mac, using npx as well and it worked. I have ember-cli globally installed.
screen shot 2019-01-25 at 15 02 31

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

No branches or pull requests

4 participants