Was ember cli 0.2.0-beta.1 released as 0.2.0 resulting in 'SyntaxError: Unexpected token <'? - ember.js

While trying to figure out how to recreate an ember app which I can't migrate to CLI, and use 'generate' to create resources, and routes with paths and dynamic segments, I was creating and deleting a test app several times. At one point it seems that ember cli tried to update to 0.2.0 and I got warnings about npm packages wanting an older version of node, so I changed the versions in the package json files for those. But when creating a new starter ember app, I get the 'SyntaxError: Unexpected token <' error (update-checker.js, _stream_writable.js, etc).
So I ran 'npm uninstall -g ember-cli' then 'npm install -g ember-cli#0.2.0-beta.1' to get beta back and now I can create starter apps again.

This issue with dependencies being out of line was probably temporary since revisions within CLI are happening so fast. If I came back the next day and cleared out module and component cache and started over, it probably would have cleared up. By reverting CLI manually I wound up with other issues with express live update, so would have to stop and restart express after every edit. I realized I wasn't ready to re-write my gruntfile as a brocfile and deal with all the other issues with migrating to Ember CLI, so started over by updating the Ember dependency in my grunt-based project and going that route, which is also frustrating and hugely problematic, but I'm sure I'm farther along in this route than I would have been in re-writing for Ember CLI.

Related

Updating Loopback 4

I am using Loopback 4 to create a REST-ful API. I'm a mobile developer by trade so typescript et al is all pretty new to me, so please be kind ;)
I created the app using CLI v1.21.4, and saw a message to say that an update is available. I therefore updated my global installation of the CLI. But then when I try and run one of the commands such as lb4 model I see the message:
The project was originally generated by #loopback/cli#1.21.4.
The following dependencies are incompatible with #loopback/cli#1.23.1:
typescript: ~3.5.3 (cli ~3.6.3)
#loopback/authentication: ^2.2.2 (cli ^3.1.1)
I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies. Could anyone offer some advice please?
Please check out https://github.com/strongloop/loopback-next/issues/3608:
During lb4 app, we add the cli version to .yo.rc.json, such as:
{
"#loopback/cli": {
"version": "1.21.4"
}
}
lb4 -v lists compatible modules that are released with the cli.
lb4 commands check if the project has incompatible versions with the current cli and prompts users to force or exit.
I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies.
The process for updating dependencies is not specific to LoopBack. If you are using npm, then simply run npm update.
Please note that TypeScript often introduces backwards-incompatible changes in semver-minor releases, 3.6 brought few of them. Be prepared to manually fix few compilation errors after the upgrade.
I think that npm update is not going to jump from v2 to v3 for #loopback/authentication, you have to request that upgrade explicitly:
$ npm install #loopback/authentication#latest
There is now a supported update procedure, which is documented here:
https://loopback.io/doc/en/lb4/Update-generator.html
It seems to be simply:
# Ensure you have the latest version of the CLI tool
npm install -g #loopback/cli
# Then ask the tool to check which packages should be upgraded
lb4 update

EmberJS: How to update Ember CLI based apps

Angular has https://update.angular.io/ that guides with the proper way to update (along with dependencies et al.). Likewise, is there a way to know how to update an Ember app properly?
Obviously, changing the version of the ember package in bower.json and doing an bower install && npm install doesn't seem to be the ideal way.
Detailed update information are included in release notes provided for ember-cli on GitHub: https://github.com/ember-cli/ember-cli/releases/
For projects that aren't using a very old version, the workflow is mostly this one:
Update globally installed ember-cli to latest stable release
Update globally installed ember-cli-update to latest stable release
Clean up your project by deleting tmp, dist and node_modules folders.
Run ember-cli-update to update project to match current blueprint.
Run ember-cli-update --run-codemods to update project to match current best practices.
Before ember-cli-update has become the official tool for updating projects, running ember init again after updating projects ember-cli dependency manually was the officially recommended workflow. ember-cli#3.2.0 was the last release for which this workflow was recommended. But ember-cli-update should support all versions for which a tag exists in ember-new-output repo, which should be true for all stable releases of ember-cli.
You could of course update your dependencies individually and not follow the recommended configuration provided by ember-cli. But be aware that uncommon combination may not work as stable as you are used to.
If your app still uses Ember App Kit, which has been deprecated in 2014, you could find a migration guide in their readme. But you should consider carefully if rewriting wouldn't be quicker than updating such an outdated app.
You can find a complete step-by-step guide for upgrading an ember here,
https://cli.emberjs.com/release/basic-use/upgrading/

Is there an easier way to debug ember addons

I have been just starting out with ember addon and one of the difficulty I am facing is to debug it. I have a separate repo for my addon(lets name it my-addon for now), and everytime I make any change, I have to
1) commit it
2) push the changes
3) go to consuming app and then re install the app from git(atleast re-run npm install git:address so I get the latest changes)
4) run ember g my-addon (because I am in older cli)
5) do build
6) and check if things are working
This process is kinda tedious, I was wondering if I can place the addon(all of it) within the consuming app itself, atleast in the dev phase so I can just build my ember app and test the addon in the consuming app itself, and once I feel good about, push it to my local git repo.
Any thoughts or approach on how you folks do it - or may be I am just missing out something and doing it wrong!
Thanks,
Dee
If you use ember-cli you can link your local addon in the consuming app. You can find all details in the user guide
Note that watchman doesn't observe local addon symlinked (there are couple of issues opened both on ember-cli and watchman). I've resolved removing watchman falling back to NodeWatcher (I'm on mac)
I am pretty sure the solution provided by #GUL must work too, but what worked for me was:
1) in the consuming dev app, I created a folder called addons and placed all my addon code there
2) in consuming dev app, in package.json I added :
"ember-addon": {
"paths": [
"addons/ember-chart"
]
}
and that worked for me!
The top answer is best here. I just wanted to offer an alternative that is useful in certain situations. npm pack at root of in development addon. Then cd back to parent project. npm install ../ember-composable-helpers-2.2.0.tgz. And then check if things are working.
npm pack will create a tarball as if published on npm.

Is the ember cli addon installation broken in Ember Cli 0.1.11?

I'm using ember cli for some small test projects to evaluate the concepts. Normal use of ember cli works for me. After 10 created small projects and using blueprints and the pod structure I decided to try the development and usage of addons. The creation of addons was not the real problem.
The problem is I can not successfully install a created addon. I also tried to install other addons created by other ember-cli users. The result is always the same. I got no error message and the addon could be found inside the node_modules directory of the addon consuming application but there is nothing installed in the app directory and it's sub directories !!!
What can I do to find the problem ?
Do you have a public available addon which could be installed definitely without problems ?
Are there log files which could be inspected to see more details (hidden error messages) ?
Best regads
Andreas
The current Ember CLI version is 0.0.12. I'm not aware of any issues with addon installations. If the issue persist, you should create an issue on ember-cli issue tracker.

Ember CLI ember new fails on ember-cli-qunit

I've been trying to use Ember CLI to set up a new ember install, but the process keeps dying when trying to install ember-cli-qunit. I'm relatively new to using npm, bower, and ember so maybe this could just be an issue with me being dumb. Here is the dump I get when running
ember new webapp
I've been working on this for a few hours and can't really figure out how to fix the issue.
Thanks in advance
You must have ran bower as root at some point, and that would've changed the permissions of bower's cache files in your home directory (as per the error in the EACCESS line). Simply changing the permissions back to your own user (as root of course) should fix the problem.
Because of similar sudo problems driving me crazy (and the system's nodejs package being dated) I switched my setup to nvm: node version manager which installs everything to my own home directory instead and I never need to use root again for node-related installations.