1
votes

Every time I generate a new ember app using the ember-cli

ember new my-app

It will have 177MB node_modules inside my-app folder. Is there a way to just install this node_modules globally and not have it on every ember project?

Note: I see you can pass --skip-npm, but how do I install the node_modules globally when I skip npm?

2

2 Answers

1
votes

After asking around on ember forum, the answer is no.

http://discuss.emberjs.com/t/does-using-ember-cli-always-have-to-install-177mb-node-modules-on-every-project/7449

But you can still work around it by creating new project using --skip-npm option and then symlink the node_modules directory. Assuming that you want to use the same version of node_modules installed by ember-cli on every project.

0
votes

yarn caches packages so I would recommend upgrading to ember 2.11 and switching to yarn. Download and install yarn from https://yarnpkg.com/ To migrate an existing project type yarn on its own. Afterwards use yarn install the same as you would with npm.

See https://yarnpkg.com/lang/en/docs/migrating-from-npm/ for more details.

At some point yarn is probably going to be the only option for ember (https://github.com/ember-cli/ember-cli/issues/6341#issuecomment-265604502) so you might as well switch now. It's pretty painless!