Ember: new project contains old dependencies - ember.js

Environment
Mac OS X 10.10.5
NodeJS 4.2.4
Globally installed NPM Packages:
npm list -g --depth=0
/usr/local/lib
├── bower#1.7.2
├── ember-cli#1.13.13
└── npm#3.5.3
Create new Ember project:
ember new super-rentals
bower.json
{
"name": "super-rentals",
"dependencies": {
"ember": "1.13.11",
"ember-cli-shims": "0.0.6",
"ember-cli-test-loader": "0.2.1",
"ember-data": "1.13.15",
"ember-load-initializers": "0.1.7",
"ember-qunit": "0.4.16",
"ember-qunit-notifications": "0.1.0",
"ember-resolver": "~0.1.20",
"jquery": "^1.11.3",
"loader.js": "ember-cli/loader.js#3.4.0",
"qunit": "~1.20.0"
}
}
Question
why did Ember create a bower.json file containing old dependencies? For example, today the latest Ember version is 2.2.0. Ember installed version 1.13.11.

The latest stable version of ember-cli is 1.13.13, which points to the latest Ember 1.13.x as part of the plan of "lockstep versioning". Unfortunately, ember-cli 2.x has been delayed, and is still in beta. So you have two choices:
Use ember-cli 2.2beta3, which will install the latest dependencies or,
Use ember-cli 1.13.13, and manually update the dependencies by editing bower.json and package.json.
Update: ember-cli 2.3.0 final has been released. Use that.

Related

Publishing in Expo, dependancy hell

I am getting these two errors in my Expo IDE:
Warning: You are using npm version 5.6.0. There may be bugs in this version, use it at your own risk. We recommend version 4.6.1.
Warning: Expo version in package.json does not match sdkVersion in manifest.
Warning: 'react' peer dependency missing. Run npm ls in C:\users\matt\sites\rg-calendar to see full warning.
If there is an issue running your project, please run npm install in C:\users\matt\sites\rg-calendar and restart.
Whn I run npm ls I have a load of missing packages, I the run npm install but I just get unmet dependancy errors.
My app.json file is:
{
"expo": {
"name": "RGUC",
"icon": "./img/calendarIcon.png",
"version": "1.0.0",
"slug": "rguc-calendar",
"sdkVersion": "21.0.0",
"ios": {
"bundleIdentifier": "com.rguc.calendar"
},
"android": {
"package": "com.rguc.calendar"
}
}
}
I have the same react-native version in my package.json:
{
"name": "rgcalendar",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-eslint": "^8.2.2",
"eslint": "^4.18.2",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"flow-bin": "^0.69.0",
"jest-expo": "21.0.0",
"react-native-scripts": "1.8.1",
"react-test-renderer": "16.0.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch",
"lint": "eslint --fix *.js",
"flow": "flow"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^21.0.0",
"react": "16.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",
"react-native-calendars": "^1.16.1",
"react-native-fontawesome": "^5.7.0",
"react-native-vector-icons": "^4.5.0",
"react-navigation": "^1.0.3",
"react-navigation-redux-helpers": "^1.0.1",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
}
}
I am using NVM:
9.5.0
* 8.10.0 (Currently using 64-bit executable)
6.11.1
4.6.1
4.4.0
How can I publish my expo project?
For downgrading NPM use this command: npm install -g npm#4 it will install 4.6.1 (at this moment).
The current Expo version is 26. Expo 21 is based on react-native 0.48 and that on react 16.0.0 So maybe you have some modules which are not compatible with that versions anymore.
For the unmet dependencies try the following: remove (or move) the node_modules folder and run npm install again also try npm cache clean.
Maybe upgrading your react versions also solves the issues.
Finally for publishing, you could install the Expo XDE which makes it much easier. Of course first you must get rid of any compile errors (not the warnings) before beeing able to publish your Expo project.
With my experience, I can say that npm version 5.6.0 is buggy. Use npm 4.6.1, its fully stable. You can do it by npm uninstall npm#5.6.0 && npm install npm#4.6.1. After that, do npm -v to see if 4.6.1 is displayed or its still 5.6.0. If this works, you will see 4.6.1 instead of 5.6.0. Let me know if this fixes your issue.
For publishing your Expo project, simply follow the steps from this link as it is -> https://docs.expo.io/versions/v19.0.0/workflow/building-standalone-apps

Ember 2.11+ can't find `ember-template-compiler` after removing ember from bower

Since Ember version 2.11, it should be possible to remove ember from bower, and instead load the library using the npm ember-source module.
I've run npm install --save-dev ember-source. I've removed ember from the bower.json file, and run rm -rf bower_components/ember.
I've added ember-source to packages.json and installed it .
When I run ember serve, it fails with this message:
Cannot find module 'path/to/myapp/bower_components/ember/ember-template-compiler'
Error: Cannot find module 'path/to/myapp/bower_components/ember/ember-template-compiler'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Class.included (path/to/myapp/node_modules/ember-cli-htmlbars-inline-precompile/index.js:48:20)
at Class.superWrapper [as included] (path/to/myapp/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:34:20)
at EmberApp.<anonymous> (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:495:15)
at Array.filter (native)
at EmberApp._notifyAddonIncluded (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:490:45)
at new EmberApp (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:140:8)
It looks like ember is trying to load ember-template-compiler from the bower module, which no longer exists. How can I tell ember that it should instead be looking for node_modules/ember-source/dist/ember-template-compiler.js?
Try updating it in package.json
"ember-cli-htmlbars-inline-precompile": "^0.3.6"
Refer https://github.com/ember-cli/ember-cli/pull/6711

ember error "Specified 2.3.0 Installed 2.4.3" on "ember s" [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
Somehow I've stuffed up my, previously working, ember.js environment.
When I try to start the server I get:
glaucon#polo ~/dev/ember-django-testbed $ ember s
Missing bower packages:
Package: ember
* Specified: 2.3.0
* Installed: 2.4.3
Run `bower install` to install missing dependencies.
If I do then run bower install I get this
glaucon#polo ~/dev/ember-django-testbed $ bower install ember --save-dev
bower ember#* cached git://github.com/components/ember.git#2.4.3
bower ember#* validate 2.4.3 against git://github.com/components/ember.git#*
bower ember#>=1.4 cached git://github.com/components/ember.git#2.4.3
bower ember#>=1.4 validate 2.4.3 against git://github.com/components/ember.git#>=1.4
But after doing that I am still left with the previous error message when I try to do ember s
I then (as per Running "ember server" fails with error) tried this
$ bower cache clean
followed by:
$ bower install ember --save-dev
But still the same error message:
Just to be sure I then followed the advice of https://stackoverflow.com/a/31167757/364088 and did the following :
$ rm -rf bower_components
$ bower cache clean
$ bower install
And .. still the same error message!
EDIT
Forgot to put this bit in. This is bower.json
glaucon#polo ~/dev/ember-django-testbed $ cat bower.json
{
"name": "ember-django-testbed",
"dependencies": {
"ember": "2.3.0",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.2",
"ember-load-initializers": "0.1.7",
"ember-qunit-notifications": "0.1.0",
"jquery": "1.11.3",
"loader.js": "^3.5.0"
},
"resolutions": {
"ember": "^2.4.3"
},
"devDependencies": {
"ember": "^2.4.3"
}
}
Edit the line in bower.json dependencies from
"ember": "2.3.0"
to
"ember": "^2.4.3"
In bower.json, change:
"ember": "2.3.0"
To:
"ember": "^2.4.3"
After that delete bower components map and run:
bower install
Source: How to update your Ember.js project?
When you upgrade your Ember app, consider using the following steps.
Upgrade ember-cli
outside your older ember app
$ cd ~
$ npm install -g ember-cli
Check your ember-cli version (outside of your project folder).
$ cd ~
$ ember -v
You should see the latest version.
Create a totally new ember application
to see, the packages in bower.json and package.json. (For example, if you have a projects folder, and you have a temp folder for short term stuffs.) You can use the version number in the app name, so you can check it later.
$ cd ~/projects/temp
$ ember new my-v24-app
This dummy app is always a good cornerstone for checking the compatible versions.
Upgrade version numbers in your old project to match with the new dummy app.
Check your bower.json and package.json align the version numbers in your old project to match with the new defaults. (Update ember-cli, ember, ember-data, etc.) It is time to double check your other packages, like sass or firebase, etc. packages also, maybe there are an updated version which is compatible with the new Ember.
Remove bower_components and node_modules
In most of the cases when you have some package conflict, the main reason is that an older and a newer version of package stay in your package/module folder. Yes, there are commands like npm prune and bower prune which clean package folders.
However, the most safest solution if you just remove these folders and reinstall all your packages.
$ cd my-updated-project
$ rm -rf bower_components node_modules
$ npm install && bower install
Good luck! :)

Installing Ember.js 2.2

I tried do install Ember.js v2.2 by following the official instructions: http://guides.emberjs.com/v2.2.0/getting-started/
installed Node.js and npm
installed Git
installed the Ember CLI via npm install -g ember-cli
Everything should be fine now.
But when I type ember -v to verify the Ember version, it says: 1.13.13
I did follow the 2.2 Instructions to the point, but I didn't get Ember.js 2.2 installed.
Any suggestions? I use Win 7.
For ember 2.2 + ember-data 2.3.1:
ember new <project> && cd <project>
Edit bower.json in your project root directory (you're there already if you followed the previous command):
Replace ember-cli-shims version number to 0.1.0
Replace ember version number to 2.2
Remove the ember-data dependency line
Add the following code just above the last }
,
"resolutions": {
"ember": "^2.2.0"
}
Edit package.json in your project root directory:
Replace ember-data version number to 2.3.1
Clean the caches, update the project dependencies and then restart ember:
npm cache clean && bower cache clean && npm install && bower install
ember serve
And you're done. Open your browser console and you should see debug messages with the 2.2 version of ember and 2.3.1 version of ember-data.
ember on the command line is actually invoking Ember-CLI, so ember -v will show you the version you have for Ember-CLI. When you do ember new <your project> to create a project then you can manually change the Ember and Ember Data dependency versions in bower.json and package.json. Make sure to update both files (for now at least) and rerun npm install and bower install in the project's root directory.
The Ember version set by default with ember-cli does not track the most recent version of Ember, but you can update to 2.x. See the changelog.
Ember itself you will interact with in the browser after running ember server and going to your localhost.

How do I update ember.js to version 2.0.1

I'm fairly new to ember.js
Before starting my project I wanted to upgrade my version to the latest 2.0.1 release.
I went through the steps in the guide.
sudo npm uninstall -g ember-cli
sudo npm cache clean
bower cache clean
sudo npm install -g ember-cli
typing: ember -v gives 1.13.8 just as it did before the 'update'
I can see that the ember-cli website says 1.13.8 is the latest version of ember-cli.
However since the emberjs.com site says the latest release is 2.0.1 and on the homepage the isntruction is to run npm install -g ember-cli I would expect the command
ember -v to return 2.0.1 if I was using the latest release.
I created a new ember project using ember new test and ran
grep -r 'version' * to see if there were any clues but found nothing of interest.
Looking at package.json reveals that ember-data 1.13.8 is one of the dependencies which is also not the latest version (2.0.0)
What (if any) is the difference between ember-cli and ember.js versions?
When I type ember -v the version of which program is being displayed?
If I'm not on the latest release, how can I get it installed?
I'm running ubuntu 14.04
The current version of Ember-cli installs Ember 1.13.8. You need to update your bower.json to use the 2.0.1 version of ember.
"dependencies": {
"ember": "2.0.1",
},
and then run bower install.