Ember-CLI uses wrong path for jQuery and QUnit - ember.js

I'm using a fresh install of ember-cli with the following versions:
~/Projects/ember_tut > ember s
version: 1.13.13
node: 4.2.1
npm: 2.14.10
os: darwin x64
bower.json looks like this:
{
"name": "ember-tut",
"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",
"pretender": "~0.10.1",
"lodash": "~3.7.0",
"Faker": "~3.0.0"
}
}
Immediately after running ember new ember_test:
~/Projects/ember_tut > ember s
version: 1.13.13
Livereload server on http://localhost:49154
Serving on http://localhost:4200/
ENOENT: no such file or directory, stat '/Users/sms/Projects/ember_tut/tmp/concat_with_maps-input_base_path-pmZyxQ2F.tmp/0/bower_components/jquery/dist/jquery.js'
Error: ENOENT: no such file or directory, stat '/Users/sms/Projects/ember_tut/tmp/concat_with_maps-input_base_path-pmZyxQ2F.tmp/0/bower_components/jquery/dist/jquery.js'
at Error (native)
at Object.fs.statSync (fs.js:849:18)
at ConcatWithMaps.keyForFile (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:90:20)
at Array.map (native)
at ConcatWithMaps.CachingWriter._conditionalBuild (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:112:65)
at /Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/read_compat.js:61:34
at lib$rsvp$$internal$$tryCatch (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:493:16)
at lib$rsvp$$internal$$invokeCallback (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:505:17)
at lib$rsvp$$internal$$publish (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:476:11)
at lib$rsvp$asap$$flush (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
It's looking for jquery.js in bower_components/jquery/dist/jquery.js but it's really in bower_components/jquery/jquery-1.11.3/dist/jquery.js.
This is easily "fixed" by creating a symlink in bower_components/jquery/ to bower_components/jquery/jquery-1.11.3/dist, but that's awfully klunky, and I'm wondering what the right way to address it is.

I found that removing all npm and bower caches, then reinstalling everything worked, which makes me think that nem's suggestion in the comments was pretty close:
npm cache clear && bower cache clean && rm -rf node_modules bower_components && npm install && bower install

Related

How can I upgrade ember 2.7 to 3.28?

My team inherited an old (around 2017) ember.js based project, and we need to choose between remake the project with vue, or just upgrade ember version.
The project use node 6.16, and here are the dependencies :
// package.json
{
"version": "1.0.0",
"private": true,
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"chart.js": "2.2.1",
"ember-ajax": "0.7.1",
"ember-browserify": "1.1.13",
"ember-cli": "2.4.2",
"ember-cli-app-version": "^1.0.0",
"ember-cli-autoprefixer": "0.6.0",
"ember-cli-babel": "^5.1.5",
"ember-cli-chart": "3.1.0",
"ember-cli-chartjs": "2.3.1",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.3.5",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.10.2",
"ember-cli-moment-shim": "2.2.0",
"ember-cli-qunit": "^1.2.1",
"ember-cli-release": "0.2.8",
"ember-cli-sass": "5.3.0",
"ember-cli-spinjs": "1.0.8",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-cookies": "0.0.9",
"ember-data": "^2.18.5",
"ember-disable-proxy-controllers": "^1.0.2",
"ember-export-application-global": "^1.0.4",
"ember-load-initializers": "^0.5.0",
"ember-models-table": "1.11.0",
"ember-moment": "7.0.0-beta.3",
"ember-pikaday": "2.1.0",
"ember-power-select": "1.0.0-beta.14",
"ember-resolver": "^2.0.3",
"ember-rl-year-picker": "^0.2.0",
"liquid-fire": "0.24.0",
"loader.js": "^4.0.0",
"semantic-ui-ember": "2.0.0-beta.0"
},
"dependencies": {
"ember-colpick": "^0.6.2",
"findup": "^0.1.5",
"semantic-ui-icon": "^2.3.3"
}
}
// bower.json
{
"dependencies": {
"ember": "~2.7",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.2",
"ember-qunit-notifications": "0.1.0",
"hammerjs": "^2.0.6",
"matchMedia": "0.2.0",
"semantic-ui": "^2.2.4",
"chartjs": "2.1.6",
"spin.js": "^2.3.2",
"mjolnic-bootstrap-colorpicker": "^2.3.6",
"colpick": "2.0.2",
"pikaday": "^1.4.0"
},
"devDependencies": {
"js-cookie": "^2.1.2"
}
}
Yes the project use bower & npm, no idea why.
Knowing this, I got some questions :
Is this normal that ember-cli from npm has not the same version as ember from bower ?
Do you think it is even possible to upgrade ember from 2.7 (or 2.4.2??) to 3.28 (which is LTS) ?
We tried to use the famous ember update and ember-cli-update but it seems that our version (2.4.2) of ember-cli doesn't support it. We can't even find from which version this is supported.
If this is possible, then how ?
Is it possible to get rid of bower ? Before upgrading or after ?
The project is quite large, so we would like to avoid remaking it with vuejs.
And to answer the "why upgrading ember ?", well, node 6 is awful. We need at least node 12
every version is upgradable! But the safest way to do so is probably to traverse from LTS to LTS.
So, 2.4 -> 2.8 -> 2.12 -> 2.16 -> 2.18 -> 3.4 -> 3.8 -> 3.12 -> 3.16 > 3.20 -> 3.24 -> 3.28
More information about Releases here
That may sound like a lot of work, but it's why it's so important to keep up with upgrades. (It may not actually be that much work, depending on the size of your app, and how much you get distracted by new features)
The general strategy at each step is:
have a good test suite
loop:
ensure you have 0 deprecations being logged while running tests
upgrade all libraries to the highest they can go while supporting your version of ember (this'll require some spelunking, but thankfully, you don't have very many non-default deps)
upgrade your ember-source version to the next LTS
Getting off bower is a little non-standard though (in that it's a one-time thing), but there are some blog posts to help you out:
The 2x release blog posts: https://blog.emberjs.com/tag/version-2-x
The 3x release blog posts: https://blog.emberjs.com/tag/version-3-x
From reading the 2-x blog posts, I found this migration guide for getting off bower: https://github.com/ember-cli/ember-cli/releases/tag/v2.13.0-beta.1
I'd probably try to do this first, because you can do the nice upgrade loop described above
However, since you're thinking about re-writing in Vue, it may make sense to just re-write in Ember 4.2 instead -- since a lot of the concepts transfer (if you're not familiar with the latest ember, I cannot recommend the tutorial enough, as it's hard to top.
For a full list of features there is this app: https://upgrade.emberjs.com/changes?fromVersion=2.4&toVersion=4.2
(It says to run some commands, I wouldn't do either of those commands being as far back as 2.4)
For better support through you're upgrade, I recommend joining ember's discord server: https://discord.gg/emberjs

Can not update doctrine-orm-module 3 in Laminas project

I am trying to update Doctrine Module in my Laminas project to version 3 using Composer but I am getting errors.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install doctrine/doctrine-orm-module 3.0.5
- Conclusion: don't install doctrine/doctrine-orm-module 3.0.4
- Conclusion: don't install doctrine/doctrine-orm-module 3.0.3
- Conclusion: don't install doctrine/doctrine-orm-module 3.0.2
- Conclusion: don't install doctrine/doctrine-orm-module 3.0.1
- Conclusion: remove doctrine/doctrine-module 2.1.10
- Installation request for doctrine/doctrine-orm-module ^3.0 -> satisfiable by doctrine/doctrine-orm-module[3.0.0, 3.0.1, 3.0.2,
3.0.3, 3.0.4, 3.0.5].
- Conclusion: don't install doctrine/doctrine-module 2.1.10
- doctrine/doctrine-orm-module 3.0.0 requires doctrine/doctrine-module ^4.0 -> satisfiable by doctrine/doctrine-module[4.0.0, 4.0.1, 4.0.2, 4.0.3].
- Can only install one of: doctrine/doctrine-module[4.0.0, 2.1.10].
- Can only install one of: doctrine/doctrine-module[4.0.1, 2.1.10].
- Can only install one of: doctrine/doctrine-module[4.0.2, 2.1.10].
- Can only install one of: doctrine/doctrine-module[4.0.3, 2.1.10].
- Installation request for doctrine/doctrine-module (locked at 2.1.10) -> satisfiable by doctrine/doctrine-module[2.1.10].
Installation failed, reverting ./composer.json to its original content.
Any ideas as to why doctrine-orm-module is not installing. I have tried uninstalling and re-installing doctrine-orm-module but with no luck.
Many thanks in advance.
Edit
composer.json
{
"name": "kryten/direct_sites",
"description": "Direct Sites",
"license": "",
"keywords": [
"framework",
"zf3",
"Ecommerce"
],
"homepage": "http://framework.zend.com/",
"require": {
"php": ">=7.3",
"laminas/laminas-component-installer": "^2.1",
"laminas/laminas-mvc": "^3.1",
"laminas/laminas-filter": "^2.9",
"laminas/laminas-crypt": "^3.3",
"laminas/laminas-mvc-plugin-flashmessenger": "^1.1",
"laminas/laminas-i18n": "^2.9",
"ocramius/proxy-manager": "^2.2",
"krytenuk/refresh-redirect": "^2.0",
"krytenuk/logger": "^2.0",
"krytenuk/recaptchav2": "^2.0",
"krytenuk/mailchimp": "^0.2.0",
"laminas/laminas-serializer": "^2.9",
"laminas/laminas-mvc-i18n": "^1.1",
"gedmo/doctrine-extensions": "^2.4",
"laminas/laminas-permissions-acl": "^2.7",
"laminas/laminas-navigation": "^2.9",
"laminas/laminas-cache": "^2.8",
"ocramius/package-versions": "^1.4",
"laminas/laminas-feed": "^2.12",
"symfony/filesystem": "^4.2",
"laminas/laminas-dependency-plugin": "^1.0",
"krytenuk/messenger": "^1.1",
"laminas/laminas-file": "^2.8",
"doctrine/doctrine-orm-module": "2.1"
},
"autoload": {
"psr-4": {
"Application\\": "module/Application/src/",
"Auth\\": "module/Auth/src/",
"Admin\\": "module/Admin/src/",
"Author\\": "module/Author/src/",
"User\\": "module/User/src/"
}
}
}
I am trying to run the command composer require doctrine/doctrine-orm-module and I get the response Using version ^3.0 for doctrine/doctrine-orm-module followed by the message above.
Try cleaning up the vendor/ directory as it might contain the too old version of doctrine/doctrine-module installed previously.
As another solution, I suggest you execute composer update and see if there are any errors.
Usually, in such cases the most common problem is that composer require ... does not upgrade the existing packages.

import of geolib doesn't work in Ember-cli

Trying to import Geolib from npm by:
npm install geolib --save
which generates in package.json
"dependencies": {
"bower": "^1.8.8",
"ember-cli": "~2.18.2",
"ember-cli-less": "3.0.1",
"geolib": "^3.3.1"
},
then in my test.js component:
import { getDistance } from 'geolib';
But ( yes, there is but ) when i access a page, it generates error:
loader.js:228 Uncaught Error: Could not find module `geolib` imported from `wash-app-dashboard/components/test`
at missingModule (loader.js:228)
at findModule (loader.js:239)
at Module.findDeps (loader.js:173)
at findModule (loader.js:243)
at requireModule (loader.js:26)
at Class._extractDefaultExport (index.js:389)
at Class.resolveOther (index.js:109)
at Class.superWrapper [as resolveOther] (ember-utils.js:418)
at Class.resolve (resolver.js:133)
at _resolve (container.js:886)
Something wrong with my settings, or what ? Cant find any solution but comment out the code.
Edit:
I know, i've got an old project to work on in my hand. Currently upgrading from 2.4 ember to 2.18 ( then to latest ember ).
I see you have "ember-cli": "~2.18.2", installed. That is a pretty old ember-cli version. Back then ember-auto-import was not part of the default blueprint.
So do you have ember-auto-import installed? It is what basically makes imports to just work.

Ember build failing

I can't build my ember app, I get this error message. Tried
rm -rf node_modules bower_components dist tmp
And installed npm and bower again but it didn't work
The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with:
Error: ENOENT: no such file or directory, stat '/home/ubuntu/workspace/qr-prototype/configtool-ember/tmp/source_map_concat-input_base_path-DgleBN9U.tmp/0/bower_components/keyboard/dist/js/jquery.keyboard.js'
at Error (native)
at Object.fs.statSync (fs.js:844:18)
at ConcatWithMaps.keyForFile (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/broccoli-concat/node_modules/broccoli-caching-writer/index.js:90:20)
at Array.map (native)
at ConcatWithMaps.CachingWriter._conditionalBuild (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/broccoli-concat/node_modules/broccoli-caching-writer/index.js:112:65)
at /home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/broccoli-concat/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/read_compat.js:61:34
at lib$rsvp$$internal$$tryCatch (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1019:11)
at lib$rsvp$asap$$flush (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
The broccoli plugin was instantiated at:
at ConcatWithMaps.Plugin (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/broccoli-concat/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/index.js:10:31)
at ConcatWithMaps.CachingWriter [as constructor] (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/broccoli-concat/node_modules/broccoli-caching-writer/index.js:21:10)
at new ConcatWithMaps (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/broccoli-concat/concat.js:22:17)
at module.exports (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/node_modules/broccoli-concat/index.js:26:10)
at EmberApp.concatFiles (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/lib/broccoli/ember-app.js:329:10)
at EmberApp.javascript (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/lib/broccoli/ember-app.js:1190:12)
at EmberApp.toArray (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/lib/broccoli/ember-app.js:1542:10)
at EmberApp.toTree (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/lib/broccoli/ember-app.js:1564:30)
at module.exports (/home/ubuntu/workspace/qr-prototype/configtool-ember/ember-cli-build.js:35:14)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/home/ubuntu/workspace/qr-prototype/configtool-ember/node_modules/ember-cli/lib/models/builder.js:55:19)
Solved It, I was importing some bower components on my ember-cli-build.js that weren't properly installed. I manually installed with bower install keyboard and it worked.
app.import('bower_components/keyboard/dist/js/jquery.keyboard.js');
app.import('bower_components/keyboard/dist/css/keyboard.min.css');
app.import('bower_components/keyboard/dist/css/keyboard-previewkeyset.min.css');
app.import('bower_components/keyboard/dist/js/jquery.keyboard.extension-all.min.js');

Trying to share Gulp project with a friend

I have made a gulp project and I am trying to share it with a friend.
Its a simple css grid with gulp tasks integrated.
You can download the package here:
https://www.dropbox.com/s/od1dsh75tegbq24/projectfolder.zip?dl=1
When you unzip the package and make sure you have node.js, ruby and gulp.js installed and try to run the gulpfile, it throws the following error:
Cannot find module "semver-regex"
After I install that (npm install --save semver-regex)
It throws the same kind of error with:
Cannot find module "array-uniq"
After I install that, the build proces works, but liveReload and watch tasks don't...
Is there a way to share Gulpfiles without all the hassle? I just want it to be downloaded and used :)
Package.json is in the root:
{
"devDependencies": {
"gulp-minify-css": "^0.3.10",
"gulp-concat": "^2.4.1",
"gulp-uglify": "^1.0.1",
"gulp-imagemin": "^1.0.1",
"imagemin-pngcrush": "^1.0.0",
"gulp-sass": "^1.0.0",
"gulp-html-replace": "^1.3.0",
"gulp-connect": "^2.0.6",
"gulp-open": "^0.2.8",
"run-sequence": "^1.0.0",
"streamqueue": "^0.1.1"
}
}