filamentgroup / criticalCSS

Finds the Above the Fold CSS for your page, and outputs it into a file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

phantomJS fatal error, rules.js

charlesrsimmons opened this issue · comments

Admittedly new to grunt but have come at this from a multitude of different approaches and still getting the below:

Running "criticalcss:home" (criticalcss) task

Something went wrong with phantomjs...
Fatal error: Command failed: [filepath]/node_modules/phantomjs/lib/phantom/bin/phantomjs [filepath]/node_modules/criticalcss/lib/rules.js css/min/style.min.css

gruntfile:

module.exports = function(grunt) {
	grunt.initConfig({
	    criticalcss: {
	        home: {
	            options: {
	                url: 'http://localsite.dev',
	                filename: 'css/min/style.min.css',
	                outputfile: 'css/min/critical.min.css',
	                width: 1200,
			height: 900,
			buffer: 800*1024,
			restoreFontFaces: true
	            }
	        }
	    }
	});
	
	grunt.loadNpmTasks('grunt-criticalcss');
		
	grunt.registerTask('default', ['criticalcss']);
	
};

Have run rm -r node_modules && npm cache clean && npm install to see if I could clean install around the issue, but still the same error.

I am having a similar issue, but I can't even install critical due to an issue with phantomjs

Here's my terminal output

npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/Cellar/node/7.9.0/bin/node" "/usr/local/bin/npm" "install" "--save" "critical"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! phantomjs-prebuilt@2.1.14 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs-prebuilt@2.1.14 install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs phantomjs-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kathryn.crawford/.npm/_logs/2017-05-15T16_45_32_698Z-debug.log
Ivie5781:pinnacle kathryn.crawford$ npm install phantomjs-prebuilt