Comments (10)
As stated in the readme file, grunt-bower
assumes you have bower
installed globally.
Try npm install -g bower
and see if it works.
from grunt-bower.
Personally, I want to handle the package management by command line, so a global installed bower
is needed.
If you prefer a more streamlined workflow, take a look at grunt-bower-task.
from grunt-bower.
FYI I tried and install of bower
globally wont be enough it has to be installed locally npm install bower
which is something I would like to avoid.
from grunt-bower.
@nrako can you be more specific on your setup? grunt
version, bower
version etc.
from grunt-bower.
Latest version for everything, but I don't think the problem rely on the version at least if you use npm > 1.0.0. Check this link http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/
from grunt-bower.
I tried several setups, grunt
0.3.7 or 0.4.0, always globally installed bower
.
Never have any issue you mentioned.
I'm really trying to tackle this down, but have no idea what's can be wrong here.
Do you need privilege to install bower
globally? Something like sudo npm install -g bower
?
Do you have $NODE_PATH
correctly set?
from grunt-bower.
Ah! Okay of course now I understand, you probably have the global node_modules directory in your NODE_PATH
.
If you try require.resolve('bower')
it probably show up bower from your NODE_PATH
.
My NODE_PATH
is setup correctly which is empty. NODE_PATH
exists mostly for legacy reason and it's highly discouraged to use it. There are many reasons for that, what happening now is one of them.
From nodejs.org
These are mostly for historic reasons. You are highly encouraged to place your dependencies locally in node_modules folders. They will be loaded faster, and more reliably.
from grunt-bower.
I'm not aware of that NODE_PATH
is a legacy environment variable, good to learn that!!
Just unset my NODE_PATH
and use npm config set prefix MY_NODE_MODULE_PATH
, everything work just fine.
But, I can't really see how this is related how you require
a globally installed package.
If setup correctly, no matter via $prefix
or $NODE_PATH
, require('some_package')
should just works.
from grunt-bower.
No It shouldn't global package are for CLI. If a package is used both as a cli and a local package require()
it must be installed both globally and locally, or maybe use npm link
(but I wouldn't except for rare case). I learnt something too with npm config set prefix
I don't really understand how it solve this but if I were you, I wouldn't change anything, you shouldn't have to.
npm folder — ref first bullet point list.
Maybe you think it is a bit anti-DRY but that just the way npm works, all dependencies of your package should be listed in your package.json.
BTW Grunt adopted an elegant solution to do that (among others) with grunt-cli
(-g) and grunt
local package where grunt-cli
is only a cli interface for the local grunt
package, maybe bower will come to that in the future.
from grunt-bower.
Just added bower
as dependency to package.json
.
Thanks for your time sharing this, much appreciated.
from grunt-bower.
Related Issues (20)
- Unable to maintain folder structure from root of package directory HOT 11
- expand: false seems broken 0.14.2 upwards HOT 2
- Problems with relative paths for packages with single files HOT 2
- Version 0.15.1+ no longer works in SailsJS HOT 3
- bootstrap.less import problem
- Windows path not supported
- dest not working (windows) HOT 1
- Copying packages defined in `packageSpecific` fails silently
- ignorePackages should allow for typical regex
- Let also *.min.js and *.min.js.map files be copied by default (configurable by option) HOT 3
- images_dest HOT 3
- Ignore devDependencies HOT 1
- Specify bower location HOT 1
- Add option to *only* include certain packages HOT 1
- [filetype]_dest options ignored after upgrading to 0.21.1 HOT 1
- override the .local directory HOT 2
- Problem with graceful-fs HOT 3
- jquery-validation doesn't get copied HOT 4
- Add support for Files Array Format in packageSpecific.files to Allow for Additional Single Package Flexibility
- font-awesome font folder not copying over
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-bower.