iclanzan / grunt-npm-install Goto Github PK
View Code? Open in Web Editor NEWGrunt task to install npm modules.
License: MIT License
Grunt task to install npm modules.
License: MIT License
I have the following grunt configuration:
[previous grunt configuration]
grunt.loadNpmTasks('grunt-npm-install');
grunt.loadNpmTasks('grunt-bower-task');
grunt.registerTask('build', ['npm-install', 'bower']);
If I have installed on my machine only 'grunt-npm-install' and run the command grunt npm-install It works fine:
$ grunt npm-install
>> Local Npm module "grunt-bower-task" not found. Is it installed?
Running "npm-install" task
[email protected] node_modules/grunt-bower-task
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
Done, without errors.
However, if I run grunt build it fails:
$ grunt build
>> Local Npm module "grunt-bower-task" not found. Is it installed?
Warning: Task "bower" not found. Use --force to continue.
Aborted due to warnings.
Any workaround for this problem? If we are not able to run this task in a chain, makes no sense to use it because I can just use npm install instead.
I can't figure out how to use this in my gruntfile. I have a series of dependencies in my project.json file, and a series of grunt.loadNpmTasks() calls at the top of my Gruntfile.js with a series of grunt.registerTask() calls at the bottom.
My attempts at using grunt-npm-install seem to have me in a chicken-and-egg situation.
Do I need the dependencies in package.json? Do I even need grunt-npm-install in package.json? How do I load the tasks if they're not even installed...do I need to install npm-install first, then when that is complete I can load the tasks and only then register new ones?
Any pointers welcome. Thanks.
Hello,
I was able to checkout the latest code and bump the version of npm to 2.5.1 (had to bump grunt-contrib-nodeunit to 0.4.1). grunt test
gives ok.
Would it be possible to bump npm to v2.x to allow npm to install local modules (new feature in 2.x)?
Add an option to run with the --production
flag.
I want to do the install and then watch.
I have a dist/
in my project file to which I copy all the "compiled" forms of files (uglified, concatenated, etc.). one thing I'd like to be able to do is copy a directory with a bunch of source and install it... but I need to do it from the directory itself.
what I would normally do is something like:
cd dist
npm install inc --save
where inc
is the directory with my other source. could I somehow get grunt-npm-install to do this?
Currently if you specify a dependency at a version that does not exist, the npm-install task will pipe the npm error but continues to the next task. I'm assuming that it continues on any npm error. Is this intentional?
It would be nice to be able to change the node_modules
directory.
Workaround now is to either grunt-contrib-copy
devDependencies (which gets all screwy with Windows' max path size) or directly call npm
via grunt-run
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.