I want to install two versions of the same package on my components directory.
On command line I can do something like:
bower install <name>=<package>#<version>
For example:
bower install bootstrap-new=bootstrap#2.3.2
bower install bootstrap-old=bootstrap#2.0.2
Having this .bowerrc file...
{
"directory": "vendor/assets/components",
"json": "bower.json"
}
I can see 2 directories:
vendor/assets/components/bootstrap-new
vendor/assets/components/bootstrap-old
The question is: How can I do the same thing using the bower.json file?
Use the --save flag bower install --save bootstrap-new=bootstrap#2.3.2 and you should end up with this in your bower.json:
"dependencies": {
"bootstrap-new": "bootstrap#2.3.2"
}
Related
It works ok on ubuntu
I installed stylelint on iOS but when I run it I get
Error: Could not find "stylelint-config-standard". Do you need a configBasedir?
My config file is:
$ cat .stylelintrc.json
{
"extends": "stylelint-config-standard",
"rules": {
"rule-empty-line-before": null,
"at-rule-empty-line-before": null
}
}
I tried "extends": ["stylelint-config-standard"],
but it didn't help
I had that error message until I installed the config
npm install stylelint-config-standard --save-dev
If you have the stylelint-config-standard dependency installed already, maybe you need to delete the node_modules folder and package-lock.json or yarn.lock if you're using yarn, and run the following command:
npm install
or with yarn
yarn install
if the stylelint-config-standard dependency isn't installed may you need to install it running:
npm install stylelint-config-standard -D
or with yarn
yarn add stylelint-config-standard -D
The solution for me was adding the overrides section to the config:
module.exports = {
overrides: [
{
files: ["**/*.scss"],
customSyntax: "postcss-scss"
}
],
rules: {...},
}
First, as tried, change the extends to be
"extends": ["stylelint-config-standard"],
but then also do npm install
On my ruby project when I try to run gulp (gulp server, gulp watch) I have the following error :
Users/workspace/website2019/gulpfile.babel.js:1
import del from 'del';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I don't get how can I fix it, if someone could help me please,
you use babel transpilation with gulp because of the file gulpfile.babel.js For this reason you need to install babel. according to the documentation you need #babel/register and #babel/preset-env for transpiling your import syntax.
So run the following command in your project folder
npm install --save-dev #babel/core #babel/register
Afterwards create the babel configuration file .babelrc in the root folder and add the following lines to it
{
"presets": [
[
"#babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
make sure you have this line in package.json
"type": "module"
I wanted to use the Native IOS search bar from https://github.com/umhan35/react-native-search-bar and when I run npm install --save (http://facebook.github.io/react-native/docs/linking-libraries-ios.html) I get error bash: library-with-native-dependencies: No such file or directory. I tried to link the library manually but it fails without showing any error. Can some one help?
I hope you did not type
npm install <library-with-native-dependencies> --save
-bash: library-with-native-dependencies: No such file or directory
In case you did, it should have been
npm install react-native-search-bar --save
If you managed to link it manually and run it, try setting a width and height for the SearchBar
.........
render(){
return (<SearchBar style={styles.searchBar} ref='searchBar' placeholder='Search'/>);
}
.........
const styles = StyleSheet.create({
searchBar:{
width: 200,
height: 40
}
});
Check whether module present in ProjectDirectory -> node_modules -> react-native-search-bar
if Not Follow Below Steps
From Your Root Directory Open package.json
Update your dependencies
Ex: Fetch from Github.
"dependencies": {
"react": "^0.14.8",
"react-native": "^0.25.1",
"react-native-search-bar": "git+https://github.com/umhan35/react-native-search-bar",
}
OR
Ex: Fetch From NPM
"dependencies": {
"react": "^0.14.8",
"react-native": "^0.25.1",
"react-native-search-bar": “^2.11.0",
}
From Terminal Change to Your Project Directory.
npm install
npm start
react-native run-ios
Then you can just import this module wherever you want to use it.
Ex: In index.ios.js
var awesomeSearchBar = require('react-native-search-bar’);
I would like to use https://github.com/MrRio/jsPDF in my ember project.
I wanted to import jsPDF as dependency, therefore I started this way:
bower install git#github.com:MrRio/jsPDF.git --save
Unfortunately, I cannot install files from plugins directory, because "plugins/*" directory is ignored in bower.json file.
I have tried overriding it this way, but without success.
"overrides": {
"jspdf": {
"ignore": [
"**/.*",
"libs",
"CNAME",
"jspdf.js",
"examples/jspdf.PLUGINTEMPLATE.js",
"todo.txt",
"wscript.py",
"build.sh",
"test",
"tools"
]
}
}
Could you please help me?
I just added a jsPDF plugins package to bower.
You can add all the plugins via
bower install jsPDF-plugins --save
I updated from 0.8.0 (I guess) or later to 0.8.5 and bower seems stuck when i do a simple bower install. It happens on my machine and with my cloudbees hosted jenkins.
I tried to do a bower clean-cache, a bower install --force and a rm -rf ~/.bower with no luck.
It always gets stuck on copying instructions such as :
bower copying /home/bigx/.bower/cache/require/34f0965def4ee39276726c265c9162b6
or any other lib, there is no pattern.
I've got the following when I try to reinstall bower (only on my machine not on cloudbees):
npm WARN unmet dependency /usr/lib/node_modules/modulus/node_modules/prompt/node_modules/winston requires pkginfo#'0.2.x' but will load
npm WARN unmet dependency /usr/lib/node_modules/modulus/node_modules/prompt/node_modules/pkginfo,
npm WARN unmet dependency which is version 0.3.0
And here is my component.json
{
"dependencies": {
"angular": "~1.0.5",
"require": "~2.1.4",
"jquery": "~1.9.1",
"angular-sanitize": "~1.0.5",
"foundation": "http://foundation.zurb.com/files/foundation-3.2.5.zip",
"less.js": "~1.3.3",
"font-awesome": "~3.0.2"
},
"devDependencies": {
"angular-mocks": "~1.0.5"
}
}
Any idea?
Regards,
Xavier
Ok so it's a bug of the unzip library used by bower
See here: https://github.com/twitter/bower/issues/314