blueFast
blueFast

Reputation: 44371

Not possible to install add-on for ember-cli

I am trying to test the ember-select-2 component. It is advertised as very easy to set-up. According to the readme:

# install addon from npm repository
$ npm install ember-select-2
# install dependencies
$ ember g ember-select-2

Installing the add-on works:

» npm install ember-select-2

But installing the dependency fails:

» ember g ember-select-2
version: 0.1.2
Unknown blueprint: ember-select-2

The only thing I have been able to find is that ember-select-2 is an extraneous npm package (whatever that means)

» npm list ember-select-2
[email protected] .../test13
└── [email protected]  extraneous

This is my ember-cli installatioon:

» ember --version
version: 0.1.2
node: 0.10.25
npm: 2.1.3

How did I manage to break such a simple how-to?

EDIT

I did some research: extraneous just means that it is not in the package.json. Adding --save solves that. So that is just a warning, and not the source of my problem.

Upvotes: 1

Views: 839

Answers (2)

iStefo
iStefo

Reputation: 428

As the maintainer of the package, I apologize for the inconvenience caused by the documentation.

I immediately fixed the command to include --save-dev, which seems to be the right way to install ember-cli addons.

Upvotes: 1

Patsy Issa
Patsy Issa

Reputation: 11293

If you don't set the save flag, the package isn't added to your package.json file as a dependency it is only downloaded into node_modules, you will either have to add it manually or use the flag and have it save you a step.

--save: Package will appear in your dependencies.

--save-dev: Package will appear in your devDependencies.

--save-optional: Package will appear in your optionalDependencies.

When using any of the above options to save dependencies to your package.json, there is an additional, optional flag:

--save-exact: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator.

More info can be found in the npm install docs.

Upvotes: 4

Related Questions