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

ember-cli module directory emptied of files #141

Closed
mixonic opened this issue Aug 7, 2017 · 8 comments
Closed

ember-cli module directory emptied of files #141

mixonic opened this issue Aug 7, 2017 · 8 comments

Comments

@mixonic
Copy link
Member

mixonic commented Aug 7, 2017

When using a yarn.lock but without bower as a dependency in package.json, the node_modules/ember-cli/ is emptied of files.

Currently when yarn is detected ember-try attempts to use it for most operations. An exception is that if bower is not a dependency, npm is used to install that dependency. I presume there is some negative interaction between the two systems that causes the files to be deleted.

@kategengler
Copy link
Member

Installing bower as-needed came in with #109

I wonder if having bower scenarios should require a global bower? Now that I think on it more installing bower for each scenario is kinda sucky (for more reasons than this bug). Thoughts @rwjblue @Turbo87?

@rwjblue
Copy link
Member

rwjblue commented Aug 7, 2017

@kategengler - Agreed. Lets use global bower, and error if not present and bower key in config is present.

@rwjblue
Copy link
Member

rwjblue commented Aug 7, 2017

FWIW, I've been fighting with this issue today as well. I believe that it only happens when using npm@5 (in my case downgrading to npm@4 resolved the error cannot find module 'ember-cli').

@kellyselden
Copy link
Member

I don't think it's that easy. Even though we removed bower as a requirement in our docs, most of the scenarios in the addon default blueprint use bower to resolve ember. (Newer) add-ons would start to get errors in CI if we switched to global bower. I suppose we could mitigate this by adding back a global install of bower in our default .travis.yml.

@Turbo87
Copy link
Member

Turbo87 commented Aug 8, 2017

I wonder if having bower scenarios should require a global bower?

for CLI itself we can't do that since we use bower programmatically and you can't do that with a global install

@billy-addepar
Copy link

I got this error while running tests with ember try:

The command ember t exited Error: Cannot find module 'ember-cli'

I am on 5.3.0 npm and do not want to downgrade npm. Could my error possibly be related to this issue?

@mixonic
Copy link
Member Author

mixonic commented Oct 24, 2017

Argh, just hit this a second time and spent another few hours debugging 😭

@kategengler
Copy link
Member

kategengler commented Oct 28, 2017

Exact steps to recreate here:

Using npm > 5:

  1. ember addon try-test-addon-yarn --yarn true
  2. Edit config/ember-try.js to add useYarn: true (the config must have bower scenarios)
  3. ember try:each

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

6 participants