bal-util grunt with docpad [closed] - gruntjs

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have some trouble with the spawn function in bal-util. I tried this example and the extended version from this docpad skeleton, but I get the same error every time:
error: An error occured:
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
→ [2013-06-01 14:03:27.698] [C:\Users\USERNAME\AppData\Roaming\npm\node_modules\docpad\out\lib\docpad.js] [DocPad.log]
I have the grunt-cli installed.
I use the following versions:
grunt - 0.4.1
bal-util - 2.1.0
How could I fix it, to run grunt properly?

That example uses an older version of Grunt, 0.3.17. In order to use with the latest version of Grunt, 0.4.1, it looks like you'll need to do the following:
Rename grunt.js to Gruntfile.js.
npm install grunt-cli grunt --save-dev
Change grunt.registerTask('default', Object.keys(gruntConfig).join(' ')); to grunt.registerTask('default', Object.keys(gruntConfig));
...and probably more stuff.
Typically you install npm install grunt-cli -g globally to access the grunt command. Since that example has docpad spawning grunt locally, step 2 has you install both locally placing the grunt command at node_modules/.bin/grunt.
I recommend reading up on the DocPad and Grunt docs. Also a shameless plug to one of my own modules for using DocPad with Grunt: https://github.com/shama/grunt-docs and an example Gruntfile.js that uses it: https://github.com/shama/dontkry.com/blob/master/Gruntfile.js

Related

How to install Polymerfire with all dependencies? [duplicate]

This question already has an answer here:
Polymerfire <firebase-app> element crashes app
(1 answer)
Closed 6 years ago.
I am trying to install and use the Polymerfire <firebase-auth> element. But, apparently, I have not successfully installed all the dependencies like firebase-sdk, for example.
I tried using Bower command pattern used to install the other Polymer elements:
command line
bower install --save polymerfire/firebase-auth
but, apparently, Polymerfire might not be setup for Bower and I received the following error.
fatal: remote error:
Repository not found.
As it stands now, I have the following dependencies listed in the Polymerfire bower.json file:
bower.json
...
"dependencies": {
"polymer": "Polymer/polymer#^1.2.0",
"firebase-sdk": "https://www.gstatic.com/firebasejs/3.0.0/firebase.js",
"app-storage": "polymerelements/app-storage#~0.9.0"
},
...
But I do not, I repeat, I do not, have any firebase-sdk directory in my project's bower_components directory.
Please help me unravel this and correctly install all the necessary dependencies for Polymerfire (including firebase-sdk) into my Polymer project.
Edit
When I do the following command:
command line
bower install --save polymerfire
It appears to work. However, when I check my bower_components directory, I still do not see any firebase-sdk subdirectory and I still get the same console error. Click here to see another question dealing with this error in more detail.
console.log
firebase-app.html:94
Uncaught ReferenceError: firebase is not defined
bower install --save firebase/polymerfire
Note: bower install --save polymerfire points to DivShot's version which is now outdated.

Why does grunt allow global installations?

I've installed both the grunt-cli and grunt globally using the -g option.
However when I try and run grunt I get this error:
grunt --gruntfile /Users/a/root/config/Gruntfile.js
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
This is confusing as it seems to say that you are suppose to do a local install.
It seems contradictory actually. I clearly have a grunt file in place.
Grunt-cli is installed globally so that the grunt command is available to be run from any location on your system. Without the global installation, you would need to rely on somewhat abstract methods of running local grunt installs (npm run-script and friends), which are clunky for this use.
The entire point of the global install is only to load and run a local Gruntfile.js using the locally installed version of Grunt. The error message indicates this:
either a Gruntfile wasn't found or grunt hasn't been installed locally to your project.
In other words, to run Grunt, you need to create a Gruntfile.js and you must have a local copy of Grunt installed to your project alongside the file. The CLI is just there to kick off the process without troublesome fiddling.

Yeoman error launching project with "grunt" command

I was following yeoman tutorial http://yeoman.io/codelab/prepare-production.html and everything worked fine until I tried to launch my project with "grunt" command then I got the following error:
Running "autoprefixer:dist" (autoprefixer) taskAutoprefixer's process() method is deprecated and will removed in next major release. Use postcss([autoprefixer]).process() insteadFile .tmp/styles/main.css created.
jit-grunt: Plugin for the "ngtemplates" task not found.If you have installed the plugin already, please setting the static mapping.See https://github.com/shootaroo/jit-grunt#static-mappings
Warning: Task "ngtemplates" failed. Use --force to continue.
Aborted due to warnings.
I use Linux Mint 17
A workaround was posted at the generator-angular github. Try modifying your Gruntfile.js to make the jit-grunt block look like this:
// Automatically load required Grunt tasks
require('jit-grunt')(grunt, {
useminPrepare: 'grunt-usemin',
ngtemplates: 'grunt-angular-templates',
cdnify: 'grunt-google-cdn'
});
This is a issue for grunt-autoprefixer which is deprecated.
I am guessing, you installed a old version of generator-angular and current version of grunt which is written in the tutorial with following commands.
npm install --global yo bower grunt-cli
npm install --global generator-angular#0.11.1
It is better to install the current version of generator-angular. Just run this and start over again.
npm install -g generator-angular

npm: "Error: invalid version: 1.0" while installing grunt plugins

While yesterday all works fine, today i am getting the printed error below, when i try to install a grunt plugin, wether it is a official grunt contrib or vendor plugin.
I am running grunt v0.4, node v0.8.20 and npm v1.2.11, System X 10.8.2.
npm install grunt-<plugin>-<name> --save-dev
npm ERR! Error: invalid version: 1.0
npm ERR! at validVersion (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:590:40)
npm ERR! at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:342:23)
...
What suprises me is that also official grunt contrib plugins (grunt-contrib-xxx) fails to install altough i expect it has a proper semver version syntax. npm-debug.log shows nothing additional to the verbose output in the console.
Any hints are appreciated.
Thx in advance
felic
Sorry for replying this late.
I am new to the grunt/nodejs stuff, so I was a bit confused and it took a while to understand what's wrong: I updated grunt to 0.4.~ at that point without editing the related project package.json to reflect the correct grunt versioning ("1.0.0" instead of "0.1.0"). Thanks for your help.
Modify package.json to
"devDependencies" : {
"grunt" : "latest"
}
Now run
sudo npm install
This installs latest grunt.
[Note : Add required dependencies to object and the command will install it all on run]
since grunt 0.4 is aimed at the v1 of node maybe the plugin you're trying to install asks for a 1.0 version of node, try to read the package.js of the plugins yo're trying to install.
as glortho asked, you could tell us explicitely what plugin causes the problem

Converts scss to css [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Does anyone know how can I convert this code to standard css?
It's not working in their editor.
http://codepen.io/andymcfee/pen/eyahr
If you click on the title CSS (SCSS) in CodePen (don't change the pre-processor with the gear) it will switch to the compiled CSS view.
In terminal run this command in the folder where the systlesheets are:
sass --watch style.scss:style.css
Source:
http://sass-lang.com/
When ever it notices a change in the .scss file it will update your .css
This only works when your .scss is on your local machine. Try copying the code to a file and running it locally.
This is an online/offline solution and very easy to convert.
SCSS to CSS converter
First of all, you have to install Ruby if it is not on your machine.
1.Open a terminal window.
2.Run the command which ruby.
If you see a path such as /usr/bin/ruby, Ruby is installed. If you don't see any response or get an error message, Ruby is not installed.
To verify that you have a current version of Ruby,
run the command ruby -v.
If ruby is not installed on your machine then
sudo apt-get install ruby2.0
sudo apt-get install ruby2.0-dev
sudo update-alternatives --install /usr/bin/gem gem /usr/bin/gem2.0 1
After then install Sass gem by running this command
sudo gem install sass --no-user-install
Then copy or add any .sass file and go to that file path and then
sass --watch style.scss:style.css
When ever it notices a change in the .scss file it will update your .css
This only works when your .scss is on your local machine. Try copying the code to a file and running it locally.
You can use sass /sassFile.scss /cssFile.css
Attention: Before using sass command you must install ruby and then install sass.
For installing sass, after ruby installation type gem install sass in your Terminal
Hint: sass compile SCSS files
Install Ruby-sass using below command
sudo apt-get -y update
sudo apt-get -y install ruby-full
sudo apt install ruby-sass
gem install bundler
Example
sass SCSS_FILE_PATH:CSS_FILE_PATH;
e.g sass mda/at-md-black.scss:css/at-md-black.css;

Resources