[GH-ISSUE #111] Cakefile appears to be invalid #90

Closed
opened 2026-02-26 05:31:18 +03:00 by kerem · 4 comments
Owner

Originally created by @JavaScriptDude on GitHub (Feb 9, 2014).
Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/111

I have been trying to tweak the project and need to run cake to re-build.

The Cakefile appears to have issues relating to the paths defined for BROWSERIFY, COFFEE, MOCHA and LESS.

For instance:

ENV = '/usr/bin/env'
BROWSERIFY = "#{ ENV } browserify"

... will resolve to "/usr/bin/env browserify" which appears to be an invalid path.

I had to alter the ENV var to point to my NPM global root and fix the ENV to be a complete path to the NPM root and include backslash.

Am I wrong in assuming that the Cakefile checked in is invalid?

There is also an issue with running the lessc command. The current npm module less does not accept the -o parameter and its failing there for %cake build

The third issue is that the error handling on the exec callback can be improved. I had to change them as follows to improve the debugging:

Before:

    throw err if err
    console.log stdout + stderr if stdout + stderr

After:

    if err
        console.log "FATAL at <step_name> - "+err+" - "+err.stack
        console.log "stdout: "+stdout
        console.log "stderr: "+stderr
        console.log "~"
        throw err

This improved syntax made sure that stdout and stderr are logged before the error is thrown and thus getting complete picture of the error.

Thanks.

Originally created by @JavaScriptDude on GitHub (Feb 9, 2014). Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/111 I have been trying to tweak the project and need to run cake to re-build. The Cakefile appears to have issues relating to the paths defined for BROWSERIFY, COFFEE, MOCHA and LESS. For instance: ``` ENV = '/usr/bin/env' BROWSERIFY = "#{ ENV } browserify" ``` ... will resolve to "/usr/bin/env browserify" which appears to be an invalid path. I had to alter the ENV var to point to my NPM global root and fix the ENV to be a complete path to the NPM root and include backslash. Am I wrong in assuming that the Cakefile checked in is invalid? There is also an issue with running the lessc command. The current npm module less does not accept the -o parameter and its failing there for %cake build The third issue is that the error handling on the exec callback can be improved. I had to change them as follows to improve the debugging: Before: ``` throw err if err console.log stdout + stderr if stdout + stderr ``` After: ``` if err console.log "FATAL at <step_name> - "+err+" - "+err.stack console.log "stdout: "+stdout console.log "stderr: "+stderr console.log "~" throw err ``` This improved syntax made sure that stdout and stderr are logged before the error is thrown and thus getting complete picture of the error. Thanks.
kerem closed this issue 2026-02-26 05:31:18 +03:00
Author
Owner

@romanr commented on GitHub (Feb 17, 2014):

For me and some other people, this is fixed by entering command export PATH=$PATH:./node_modules/.bin

<!-- gh-comment-id:35285786 --> @romanr commented on GitHub (Feb 17, 2014): For me and some other people, this is fixed by entering command `export PATH=$PATH:./node_modules/.bin`
Author
Owner

@JavaScriptDude commented on GitHub (Feb 17, 2014):

I was originally trying to build on Windows and now understand the first issue I noted about /user/bin/env.

I have followed the instruction: export PATH=$PATH:./node_modules/.bin

Following the cake errors, I installed the Node modules browserify, coffee-script, mocha and less.

I am stuck at 'less' task. The cake script is failing at the execution of LESS. I checked the stdout and stderr and apparently, the current version of less does not have -compress or -o options.

Here is the error:

usage: lessc [option option=parameter ...] <source> [destination]

If source is set to `-' (dash or hyphen-minus), input is read from stdin.

options:
  -h, --help               Print help (this message) and exit.
  --include-path=PATHS     Set include paths. Separated by `:'. Use `;' on Windows.
  -M, --depends            Output a makefile import dependency list to stdout
  --no-color               Disable colorized output.
  --no-ie-compat           Disable IE compatibility checks.
  --no-js                  Disable JavaScript in less files
  -l, --lint               Syntax check only (lint).
  -s, --silent             Suppress output of error messages.
  --strict-imports         Force evaluation of imports.
  ...etc...

The output matches the usage instructions for lessc.

Am I on the wrong version of less?

  • Tim
<!-- gh-comment-id:35331958 --> @JavaScriptDude commented on GitHub (Feb 17, 2014): I was originally trying to build on Windows and now understand the first issue I noted about /user/bin/env. I have followed the instruction: export PATH=$PATH:./node_modules/.bin Following the cake errors, I installed the Node modules browserify, coffee-script, mocha and less. I am stuck at 'less' task. The cake script is failing at the execution of LESS. I checked the stdout and stderr and apparently, the current version of less does not have -compress or -o options. Here is the error: ``` usage: lessc [option option=parameter ...] <source> [destination] If source is set to `-' (dash or hyphen-minus), input is read from stdin. options: -h, --help Print help (this message) and exit. --include-path=PATHS Set include paths. Separated by `:'. Use `;' on Windows. -M, --depends Output a makefile import dependency list to stdout --no-color Disable colorized output. --no-ie-compat Disable IE compatibility checks. --no-js Disable JavaScript in less files -l, --lint Syntax check only (lint). -s, --silent Suppress output of error messages. --strict-imports Force evaluation of imports. ...etc... ``` The output matches the usage instructions for lessc. Am I on the wrong version of less? - Tim
Author
Owner

@JavaScriptDude commented on GitHub (Feb 17, 2014):

Minor correction: -compress will work because of they way that lessc wrote their parameter parsing. the -o option is not defined anywhere. I cannot find it in older versions either.

This issue is the same on Windohs and Linux with latest build of log.io and less.

<!-- gh-comment-id:35333490 --> @JavaScriptDude commented on GitHub (Feb 17, 2014): Minor correction: -compress will work because of they way that lessc wrote their parameter parsing. the -o option is not defined anywhere. I cannot find it in older versions either. This issue is the same on Windohs and Linux with latest build of log.io and less.
Author
Owner

@msmathers commented on GitHub (Aug 1, 2014):

This is an issue specific to Windows, which isn't officially supported yet. Builds on linux work fine as long as the correct version of less is used (~1.3.3) or the task is invoked via npm's install or run-script prepublish.

<!-- gh-comment-id:50852217 --> @msmathers commented on GitHub (Aug 1, 2014): This is an issue specific to Windows, which isn't officially supported yet. Builds on linux work fine as long as the correct version of less is used (~1.3.3) or the task is invoked via npm's `install` or `run-script prepublish`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/log.io-NarrativeScience-old#90
No description provided.