How to `ember install` for a package that is npm linked? [resolved]


#1

Hi,

When working on an addon I currently do the following:

cd ~/my-addon
npm link
cd ~/my-app
npm link my-addon

With https://ember-cli.com/extending/#link-to-addon-while-developing it works great.

Now I would like to experiment with the steps happening after a future user would run ember install my-addon.

How would you run this command in the context of a local package in development?

Cheers


#2

ember install is effectively the combination of two commands:

npm install —save addon-name
ember generate addon-name

# or (when a yarn.lock is present)
yarn add addon-name
ember generate addon-name

Since you have already taken care of the first thing by linking (as long as you have also added the linked addon to package.json), you can run ember generate addon-name to test the addons blueprint.


#3

Thank you very much, this is exactly what was needed.


#4

ember generate command no longer works. It will either fail with the message “The ember generate <entity-name> command requires an entity name to be specified.” (even when overriding normalizeEntityName) or do nothing at all.


#5

I’m trying to reproduce this and I cannot. I’m using the newly released ember-cli 3.2.0, and running an addon’s default blueprint (in my case I ran ember g liquid-fire).