Closed marcus-at-localhost closed 7 years ago
@marcus-at-localhorst
I assume npm i node-sass@3.3.3
fails, too?
Maybe a dependency update helps?
So you can clone this repo and run npm i
inside of it. You should see the same behavior.
Then update the dependencies manually and see if one updates helps. I'd give updating grunt-contrib-compass
the first shot... :)
Thanks for the advice. I think I got it running by trial and error.
I updated "grunt-contrib-compass": "^1.1.1",
and "phantomas": "~1.18.0",
(earlier version failed to build or something).
So I am able to run the task with this output:
Running "phantomas:gruntSite" (phantomas) task
PHANTOMAS EXECUTION(S) STARTED.
>>5 Phantomas execution(s) done -> checking results:
>>Phantomas execution not successful -> [object Object]
>>Phantomas execution not successful -> [object Object]
>>Phantomas execution not successful -> [object Object]
>>Phantomas execution not successful -> [object Object]
>>Phantomas execution not successful -> [object Object]
WRITING RESULT FILES.
>> SOMETHING WENT WRONG...
>> No run was successful.
Maybe the latest Phantomas version causes it to fail? Any idea what else to try?
@marcus-at-localhorst
Please provide your grunt configuration, node version and specific installed dependencies. :) Without that information it's just wild guessing. ;)
I have to be able to reproduce it. :)
I installed grunt-phantomas again (package.json at the end), without any errors. This is my (stripped down) gruntfile.js (using https://www.npmjs.com/package/jit-grunt to load plugins, if that matters). Output is the same. /phantomas/data/ directory gets created but is empty.
Node/NPM Version:
node v6.9.2
npm v4.0.5
module.exports = function (grunt) {
require('time-grunt')(grunt);
// just in time grunt
require('jit-grunt')(grunt);
// -- Init
grunt.initConfig({
// ---- Vars
pkg: grunt.file.readJSON('package.json'),
template_path: "pico/themes/default",
phantomas: {
gruntSite : {
options : {
indexPath : './phantomas/',
options : {},
url : 'http://gruntjs.com/',
buildUi : true
}
}
},
// ---- Tasks
watch: {
options: {
spawn: false,
},
less: {
files:['<%= template_path %>/less/*.less'],
tasks:['newer:less:development','newer:postcss','cssmin']
}
}
});
// -- Watch Event
grunt.event.on('watch', function(action, filepath, target) {
grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
});
// -- Register Task
grunt.registerTask('default', ['less:development','postcss','cssmin']);
grunt.registerTask('js', ['uglify']);
grunt.registerTask('svg', ['svgmin']);
};
package.json (stripped down)
"devDependencies": {
"analyze-css": "^0.12.4",
"autoprefixer": "^6.6.0",
"grunt": "^0.4.5",
"grunt-contrib-compass": "^1.1.1",
"grunt-contrib-cssmin": "^0.13.0",
"grunt-contrib-less": "^1.4.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-criticalcss": "^2.1.0",
"grunt-cssbeautifier": "^0.1.2",
"grunt-csso": "0.6.5",
"grunt-newer": "^1.1.1",
"grunt-phantomas": "^0.13.0",
"grunt-postcss": "^0.6.0",
"grunt-svgmin": "^4.0.0",
"jit-grunt": "^0.9.1",
"matchdep": "^0.3.0",
"postcss": "^5.2.7",
"request": "2.25.0",
"time-grunt": "^1.2.1"
}
updated grunt-phantomas package.json
{
"name": "grunt-phantomas",
"description": "Grunt plugin for phantomas",
"version": "0.12.1",
"homepage": "https://github.com/stefanjudis/grunt-phantomas",
"author": {
"name": "stefan judis",
"email": "stefanjudis@gmail.com",
"url": "http://stefanjudis.de"
},
"repository": {
"type": "git",
"url": "https://github.com/stefanjudis/grunt-phantomas.git"
},
"bugs": {
"url": "https://github.com/stefanjudis/grunt-phantomas/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/stefanjudis/grunt-phantomas/blob/master/LICENSE-MIT"
}
],
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "grunt test",
"coveralls": "jscoverage tasks/lib/phantomas.js && PHANTOMAS_COV=1 nodeunit --reporter=lcov test/lib/phantomasTest.js | coveralls"
},
"devDependencies": {
"coveralls": "~2.11.0",
"grunt": "^0.4.5",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-compass": "^1.1.1",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.4.0",
"grunt-contrib-uglify": "~0.5.0",
"grunt-contrib-watch": "~0.6.0",
"grunt-jscs": "^0.7.1",
"jscoverage": "~0.5.0-rc1",
"nodeunit": "~0.9.0"
},
"peerDependencies": {
"grunt": ">=0.4.0"
},
"keywords": [
"gruntplugin",
"phantomas",
"performance",
"metrics",
"phantomjs"
],
"dependencies": {
"bluebird": "~2.3.0",
"phantomas": "~1.18.0",
"node-fs": "~0.1.7",
"lodash": "~2.4.1",
"html-minifier": "~0.6.0",
"json2csv": "~2.2.1"
}
}
Thanks!
I'll try to have a look, feel free to remind me in a few days in case I forgot.
I will! I tried to debug it, but I have no clue how to debug promises and objects on a cli :).
I suspect phantomas() call returns nothing.
Although, I can use phantomas https://github.com/macbre/phantomas --verbose --runs 5
on cli.
(because I also installed phantomas globally).
I am on Windows.
I'll updated all dependencies and try to solve to more issues today...
Let me know in case you run into further troubles. :)
Thanks for your work.
I was able to install it without errors (but only if I add "grunt-phantomas": "~0.12.2",
in my local package.json - npm install grunt-phantomas --save-dev
pulls version 0.13.0 which is older).
Unfortunately the grunt task is still not working.
DEBUG=* grunt phantomas -v
phantomas:results Process returned code #255
phantomas:results Error when parsing JSON (SyntaxError: Unexpected end of JSON input):""
phantomas:results Rejecting a promise with 255 exit code
...
So I guess phantomas is making trouble and doesn't return anything
aaah sh... .
Sorry I made a mistake in the release... it should have be 0.14.0.
Let me release another version. Will be there in 5min. Sorry for inconvenience.
Okay. I released 0.14.0. It's not visible at npm for me but should appear soon. Can you try again?
Installation works well now. Thank you so much.
Do you have an idea how to debug the phantomas 255 error?
Open another issue and add the full output of grunt-phantomas
, grunt config for phantomas and node version.
Also executing the cli of phantomas itself and check if the same error appears there. :)
Hey, just a quick note about the error 255 I got on Windows platform, even after your fixes.
It turned out that the round brackets in the user-agent field need to be escaped. Details here: https://github.com/macbre/phantomas/issues/687
Until this is fixed in phantomas you should put a properly escaped (^^)
) user-agent in grunt-phantomas or leave round brackets off.
phantomas: {
gruntSite : {
options : {
indexPath : './phantomas/',
options : {
'film-strip':false,
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64^^) AppleWebKit/537.36 (KHTML, like Gecko^^) Chrome/57.0.2987.37 Safari/537.36'
},
url : 'http://google.com/',
buildUi : true
}
}
},
I really like grunt-phantomas. What's the reason you stopped developing it? Do you use something else? Did it fail in some way? (Beside that there is maybe not enough time for development)
Cheers.
@marcus-at-localhorst
What's the reason you stopped developing it?
Well... Life I guess.
I got another job with a different stack. I've never made it to make this project task runner independent (shouldn't be too hard though). And that's why I stopped using it myself. Which meant that the prio went down.
I was always looking/asking for help, which didn't work (still looking for contributors ;) ).
So I think it's the usual open source project story. ;)
Did it fail in some way?
Don't think so. Surely there are other tools out there, but I think it's still a good tool. :)
@stefanjudis thanks for the insight and good luck!
Hi, is there a chance to get this updated? The installation fails with
I guess this is related to node-sass and new node/npm version, but I have no idea how to solve this.
Hope there is a way to get this running.
Thanks.