简体   繁体   中英

Installing addon in ember-cli

I am trying to install ember-simple-auth in ember CLI, but something is wrong. I have created a new ember CLI project, and run the following to install ember-simple-auth.

npm install --save-dev ember-cli-simple-auth
ember generate ember-cli-simple-auth

I also ran bower install just to make sure I wasn't missing anything else, and have checked that ember-simple-auth does exist in bower_components . However, when I try to import it using

import Base from 'simple-auth/authorizers/base';

ember server throws an error:

ENOENT, no such file or directory '/home/me/Projects/spa_client/tmp/tree_merger-tmp_dest_dir-8L6qfwzZ.tmp/simple-auth.js'

What have I missed?

Edit

Ember CLI version:

$ ember -v
version: 0.0.46
node: 0.10.25
npm: 1.4.27

The ember-cli-simple-auth shim whould import the necessary bits automatically, when faced with ENOENT in similar situations I often find that it can be cleared by simply doing rm -r tmp to clear the ember-cli tmp directory and force it to re-build - seems like ember-cli doesn't pick-up some of the new pieces without a complete re-build of the directory structure.

If you dispense with the ember-cli shim and go down the bower route you need to app.import in your Brocfile? Something like:

app.import('bower_components/ember-simple-auth/ember-simple-auth.js');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM