I am trying to install Foundation but its continuously giving me conflict with Jquery
λ bower install foundation
bower foundation#x cached https://github.com/zurb/bower-foundation.git#5.5.1
bower foundation#x validate 5.5.1 against https://github.com/zurb/bower-foundation.git#x
bower foundation#* cached https://github.com/zurb/bower-foundation.git#5.5.1
bower foundation#* validate 5.5.1 against https://github.com/zurb/bower-foundation.git#*
bower jquery#>= 2.1.0 cached https://github.com/jquery/jquery.git#2.1.3
bower jquery#>= 2.1.0 validate 2.1.3 against https://github.com/jquery/jquery.git#>= 2.1.0
bower modernizr#>= 2.7.2 cached https://github.com/Modernizr/Modernizr.git#2.8.3
bower modernizr#>= 2.7.2 validate 2.8.3 against https://github.com/Modernizr/Modernizr.git#>= 2.7.2
bower jquery.cookie#~1.4.0 cached https://github.com/carhartl/jquery-cookie.git#1.4.1
bower jquery.cookie#~1.4.0 validate 1.4.1 against https://github.com/carhartl/jquery-cookie.git#~1.4.0
bower fastclick#>=0.6.11 cached https://github.com/ftlabs/fastclick.git#1.0.6
bower fastclick#>=0.6.11 validate 1.0.6 against https://github.com/ftlabs/fastclick.git#>=0.6.11
bower jquery-placeholder#~2.0.7 cached https://github.com/mathiasbynens/jquery-placeholder.git#2.0.9
bower jquery-placeholder#~2.0.7 validate 2.0.9 against https://github.com/mathiasbynens/jquery-placeholder.git#~2.0.7
bower ECONFLICT Unable to find suitable version for jquery
My bower.json file is this
{
"name": "refactor",
"private": true,
"dependencies": {
"jquery": "~1.11.1",
"raphael": "1.3.x",
"font-awesome": "~4.3.0",
"foundation": "x"
}
}
Use resolutions in your bower.json
{
"name": "refactor",
"private": true,
"dependencies": {
"jquery": "~1.11.1",
"raphael": "1.3.x",
"font-awesome": "~4.3.0",
"foundation": "x"
},
"resolutions": {
"jquery": "~1.11.1"
}
}
This will force bower to use that specific version of jQuery.
Best way to start with is to do
bower cache clean
After that when you do
bower install it will ask you
'Unable to find a suitable version for <Your Dependency Name>, please choose one: ,
then you can enter !1
or !2 , or whatever suits your needs the best.
This essentially adds the resolution block into bower.json as mentioned by #esbanarango but it just gives more control and understanding over what you are doing.
Try using this for the Jquery version:
"jquery": ">= 2.0.0"
However I think you would only need Foundation as a dependency:
or:
{
"name": "PROJECT_NAME",
"dependencies": {
"foundation": "~5.4.7"
}
}
also check here for more details:
http://foundation.zurb.com/docs/sass.html
Related
I've an npm command line application that i've built not so long ago and it worked fine. Now that i've updated it, and due to changes in the versions of typescript over the period, i'm getting an error when i want to run this package which says:
Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
Here is the package.json file:
{
"name": "initialiseur",
"version": "4.0.4",
"main": "src index.ts",
"author": "#crispengari",
"license": "MIT",
"bin": "src/index.ts",
"description": "THIS IS A BOILER PLATE THAT INITIALIZE A NODE EXPRESS BACKEND FOR TYPESCRIPT AND JAVASCRIPT",
"scripts": {
"watch": "tsc -w",
"start": "ts-node src/index.ts",
"dev": "nodemon dist/index.ts",
"start:fast": "tsnd --respawn src/index.ts"
},
"dependencies": {
"#types/inquirer": "^7.3.3",
"#types/node": "^17.0.42",
"#types/npm": "^7.19.0",
"chalk": "^4.1.2",
"cors": "^2.8.5",
"cross-fetch": "^3.1.5",
"dotenv": "^10.0.0",
"inquirer": "^8.1.2",
"node-fetch": "^3.2.6",
"octokit": "^1.7.2",
"ts-node": "^10.8.1",
"typescript": "^4.6.5"
},
"devDependencies": {
"#types/node-fetch": "^2.6.1",
"nodemon": "^2.0.12",
"ts-node-dev": "^2.0.0"
},
"bugs": {
"url": "https://github.com/CrispenGari/initialiseur/issues"
},
"homepage": "https://github.com/CrispenGari/initialiseur#readme",
"keywords": [
"node.ts",
"node.js",
"typescript",
"ts",
"nodejs-backend",
"javascript",
"js",
"express",
"backend"
]
}
When i'm testing it locally by running:
npm start
# or
yarn start
Everything is working fine, but after publishing it to npm to start it i run the following command:
npx initialiseur
Then I'm getting the error from a command line. The whole error is as follows:
C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:42536
ts.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
^
Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
at Object.resolveTypeReferenceDirective (C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:42536:18)
at C:\Users\crisp\AppData\Roaming\npm\node_modules\ts-node\src\resolver-functions.ts:131:51
at Array.map (<anonymous>)
at Object.resolveTypeReferenceDirectives (C:\Users\crisp\AppData\Roaming\npm\node_modules\ts-node\src\resolver-functions.ts:130:31)
at actualResolveTypeReferenceDirectiveNamesWorker (C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:116673:163)
at resolveTypeReferenceDirectiveNamesWorker (C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:116973:26)
at processTypeReferenceDirectives (C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:118455:31)
at findSourceFileWorker (C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:118340:21)
at findSourceFile (C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:118195:26)
at processImportedModules (C:\Users\crisp\AppData\Roaming\npm\node_modules\initialiseur\node_modules\typescript\lib\typescript.js:118601:25)
From the above error i can tell that the problem maybe comming from typescript, I'v tried changing version of typescript but still it's not working. In my src/index.ts it looks as follows:
#!/usr/bin/env ts-node
import path from "path";
import inquirer from "inquirer";
import { writeFile, readFile } from "fs/promises";
....
Running npm install -g ts-node#latest fixed it for me. I needed to update my globally installed ts-node version.
To reiterate previous answers for yarn users:
yarn add -D ts-node#latest solved it for me. These are my versions now:
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
The top answer probably shouldn't recommend a downgrade.
Edit
If you continue to face issues, try deleting your node_modules folder and reinstalling by running yarn.
If it still doesn't work, you may need to add these versions to your resolutions field in package.json, and then run yarn install --force.
{
"resolutions": {
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
}
}
However, I consider this a bit of a temporary measure, and I wouldn't recommend leaving the resolutions in forever.
Getting the same as of a couple of days.
Reverting ts-node to v10.6.0 fixes it for me.
It is hapening in typescript 4.7.
I lowered my typescript to 4.6.4, and the error disappeared
Update the Typescript as #alex-totolici has suggested: npm i typescript#latest
And update the ts-node: npm i ts-node#latest
Remeber to distinguish between global ts-node and package ts-node;
You have to use npx to run local ts-node
> npx ts-node ...
Anyway, this is what I finally found after 30 mins of repeatedly rm -rf node_nodules and yarn add ts-node#latest.
These changes in the package.json worked for me.
"ts-node": "~10.7.0"
"typescript": "~4.6.4"
Try updating all you packages including typescript
To update typescript: npm i typescript#latest
Here is a package to check for updates: https://www.npmjs.com/package/npm-check-updates
I had the same issue, and already ran the latest versions of typescript and ts-node.
Updating nodemon npm install -g nodemon#latest solved it for me!
I just figure out that the problem was coming from inquirer import when i commented the import it just worked:
// import inquirer from "inquirer";
I suspect that the inquirer types and my current typescript version are not lining up. So you must as well try to debug by commenting imports if the above answers did not work for you.
I don't know exactly why but the problem comes from a #type package, you can find a line similar to this /// <reference types='node' /> if you delete it won't have this problem anymore
Using ts-node-dev version 2.0.0 fixes this problem.
Note you'll have to manually specify the version as by default this version may not get installed.
Running this solved the issue:
npm install --save-dev ts-node#latest
Try newer version of typescript and ts-node .
i have the same problem but it works fine now with below version:
"ts-node": "~10.7.0",
"typescript": "~4.6.4",
ERROR in Debug Failure. False expression: Non-string value passed to ts.resolveTypeReferenceDirective, likely by a wrapping package working
with an outdated resolveTypeReferenceDirectives signature. This is probably not a problem in TS itself.
I still see the issue even after updating the version of Typescript & ts-node with latest versions.
this is probably a newbie question, but i do not understand why bower (1.7.9) cannot find a suitable version for Angular when i run:
bower install
or when it cannot find a suitable version for Angular-translate when i run:
bower update
(Why does it even give me a different error when i run either command in the above?)
I have updated every package to their latest versions and I did not find any package which would require an older version of Angular. Here is my bower.json:
{
"name": "test",
"homepage": "http://www.google.nl",
"version": "0.2.1",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"angular": "1.5.9",
"angular-animate": "1.6.0-rc.2",
"angular-bootstrap": "2.3.0",
"angular-cookies": "1.6.0-rc.2",
"angular-hotkeys": "0.2.2",
"angular-i18n": "1.6.0-rc.2",
"angular-route": "1.6.0-rc.2",
"angular-translate": "2.13.1",
"angular-sanitize": "1.6.0-rc.2",
"angular-translate-loader-static-files": "2.8.1",
"angular-ui-bootstrap-datetimepicker": "2.0.3",
"angular-loading-bar": "0.9.0",
"jquery": "3.1.1",
"moment": "2.17.1",
"ng-dialog": "0.6.4",
"ng-focus-if": "1.0.7",
"ng-tags-input": "3.1.1",
"ngInfiniteScroll": "https://github.com/hlsolutions/ngInfiniteScroll.git#scroll-on-any-lement",
"angular-ui-select": "0.19.6",
"placeholders": "https://github.com/jamesallardice/Placeholders.js.git#~4.0.1",
"angular-atomic-notify": "~1.0.3",
"underscore": "https://github.com/components/underscore.git#~1.8.3",
"angulartics-google-analytics": "0.4.0",
"angular-ui-tinymce": "~0.0.17",
"angular-collection": "~0.5.2",
"angular-mocks": "1.6.0-rc.2",
"angular-translate-handler-log": "2.13.1"
}
}
The problem I see is related to:
"angular-translate": "2.13.1",
...
"angular-translate-loader-static-files": "2.8.1",
The problem is:
- you are requesting exact versions
- angular-translate-loader-static-files also requests angular-translate, but it demands the same version (2.8.1)
- bower does not allow multiple version of the same library
One solution would be:
"angular-translate-loader-static-files": "2.13.1"
The same problem is with angular, you should use "angular": "1.6.0-rc.2" since you already request this version for other modules that depend on angular.
However, this is not necessarily the best way to go, because for example I see you are using some libraries that want angular < 1.6 (ngInfiniteScroll) so you will not be able to make these work in your project if you really want to use the 1.6 version.
A better idea would be to require version more loosely (e.g. "angular": ">=1.5.x"), then let bower find the most suitable version for all your dependencies - but this will most likely require you to work with older versions or risk incompatibility issues.
It often happens when you already have an old version of a library (here it's angular) downloaded in your bower_components of your project.
Generally to fix this, i just empty my bower_components before redo a bower install and everything get back to the normal.
Hope this will help in your case.
See if the final answer to a similar question helps
"Instead of running bower install library -save I did added the latest versions of the libraries directly to my bower.json and added the resolutions..."
So I'm using angular in a rails app and using bower to manage my javascript libraries. There have been a few times that have come up where I've had to modify the functionality of certain bower packages. What I've done previously is just copy the source file pulled in by bower, make the changes, then save that in my assets directory and pull that file in directly in my application.js manifest.
Is there a better/cleaner way to do this so that all my javascripts are still pulled in via bower? I know that for gemfiles, I can fork a repo and reference that version in my gemfile, is there something similar for bower?
Are there any best practices here? Thanks a bunch.
EDIT: Also I'm using a bower.json file, something like this:
{
"lib": {
"name": "bower-rails generated lib assets",
"dependencies": {
"angular": "latest",
"angular-ui-router": "latest",
"angular-animate": "latest",
"bootstrap-sass-official": "latest",
"angular-deckgrid":"latest",
...
}
},
"vendor": {
"name": "bower-rails generated vendor assets",
"dependencies": {
// "three.js" : "https://raw.github.com/mrdoob/three.js/master/build/three.js"
}
}
}
You can do the same for bower packages. Fork the repo, make your changes, and then create your own Bower package following this. Once it has been registered, you can just bower install <your-package> directly every time :)
I am currently using cropper and have jquery#latest in my package.json. However, cropper requires jquery as its own dependency which ends up with two versions of jquery being installed and used. I tried adding this to my npm-shrinkwrap.json:
"cropper": {
"version": "2.3.3",
"from": "https://registry.npmjs.org/cropper/-/cropper-2.3.3.tgz",
"resolved": "https://registry.npmjs.org/cropper/-/cropper-2.3.3.tgz",
"dependencies": {
"jquery": {
"version": "3.1.0",
"from": "jquery#latest"
}
}
},
But all that ended up happening is that I have two identical versions of jquery installed.
What I need to do is to get cropper to use the local version of jquery in my package.json and not its own version of it. The only way I have accomplished this is to manually delete the node_modules folder from within cropper but this is not a long term solution.
How would I get cropper to use my local jquery? Or get shrinkwrap to not install croppers jquery dependency?
I intend to use a certain feature of angular-datatables, namely: creating filter input fields below individual columns. A demo.
This feature is available only in the dev version of the package.
I set "angular-datatables": "dev" version in my bower.json "dependencies" object, and issued:
$ bower install --save
bower not-cached git://github.com/l-lin/angular-datatables.git#dev
bower resolve git://github.com/l-lin/angular-datatables.git#dev
bower checkout angular-datatables#dev
bower resolved git://github.com/l-lin/angular-datatables.git#3c05e6a2f9
bower install angular-datatables#3c05e6a2f9
angular-datatables#3c05e6a2f9 bower_components/angular-datatables
├── angular#1.2.26
├── datatables#1.10.2
└── jquery#2.1.1
The contents of bower_components/angular-datatables ended up like this.
Next, I tried clearing my browser cache. Repeated the step above, still the version of angular-datatables remains to be 0.2.0.
I also tried issuing bower cache clean, followed by a bower install --save, but in vain.
$ bower info angular-datatables tells me that the following versions are available:
bower angular-datatables#* cached git://github.com/l-lin/angular-datatables.git#0.2.0
bower angular-datatables#* validate 0.2.0 against git://github.com/l-lin/angular-datatables.git#*
{
name: 'angular-datatables',
version: '0.2.0',
author: 'l-lin',
main: 'dist/angular-datatables.js',
ignore: [
'.bowerrc',
'.editorconfig',
'.git*',
'.jshintrc',
'Gruntfile.js',
'test',
'node_modules',
'src',
'.travis.yml',
'vendor',
'data.json',
'data1.json',
'demo',
'favicon.png',
'index.html',
'README.md',
'server',
'styles',
'_config.yml',
'grunt',
'images',
'package.json'
],
dependencies: {
angular: '>=1.2.6',
jquery: '>=1.11.0',
datatables: '>=1.9.4'
},
devDependencies: {
'angular-mocks': '1.2.6',
bootstrap: '3.0.1',
'angular-bootstrap': '0.10.0'
},
homepage: 'https://github.com/l-lin/angular-datatables'
}
Available versions:
- 0.2.0
- 0.1.1
- 0.1.0
- 0.0.3
- 0.0.2
- 0.0.1
Next, I reverted back to v0.2.0, and then used the install command with a #dev suffix.
$ bower install angular-datatables#dev --save
bower angular-datatables#dev not-cached git://github.com/l-lin/angular- datatables.git#dev
bower angular-datatables#dev resolve git://github.com/l-lin/angular-datatables.git#dev
bower angular-datatables#0.2.0 cached git://github.com/l-lin/angular-datatables.git#0.2.0
bower angular-datatables#0.2.0 validate 0.2.0 against git://github.com/l-lin/angular-datatables.git#0.2.0
bower angular-datatables#dev checkout dev
bower angular-datatables#dev resolved git://github.com/l-lin/angular-datatables.git#83ce3847da
Unable to find a suitable version for angular-datatables, please choose one:
1) angular-datatables#dev which resolved to 83ce3847da
2) angular-datatables#0.2.0 which resolved to 0.2.0 and is required by zap-adm-ang
Prefix the choice with ! to persist it to bower.json
? Answer:: 1
This updated my bower.json file, to "angular-datatables": "dev", however when I open the angular-datatables.js file in the bower_components/angular-datatables/dist/ directory, the version still remains 0.2.0. The problem persists.
Here is my discussion of the issue with the angular-datatables package maintainer (in case I missed out on some details).
One possible solution that the package maintainer suggested is to use the following (upcoming) version of angular-datatables:
/*!
* angular-datatables - v0.2.1
* https://github.com/l-lin/angular-datatables
* License: MIT
*/
which is currently available here and should soon be released.
Did the trick for me. The feature is available.
I am still really curious as to why the above-described process of #dev version installation didn't work for me.