Giter Club home page Giter Club logo

coco's Introduction

Coco

is a CoffeeScript dialect that aims to be more radical and practical.

Why

On its way to hide JavaScript's bad parts, CoffeeScript has accumulated own quirks: horrible variable scope, awkward ranges, confusing and/or pointless keywords, verbose file extension, and so on. Coco tries to amend them, entwining good parts of both.

Principles

  • Respect JS semantics and idioms.
  • Die for DRY.
  • Perl over Ruby.
  • Fewer keywords, punctuations and runtime errors.

Differences

Documents

Installation

Get Node.js and npm, then:

  • npm i -g coco
  • git clone git://github.com/satyr/coco.git && cd coco && bin/coke i

Changelog

0.9.1

  • Added if-block. (#151)
  • Added for-let. (#164)
  • Added <> aka lef. (#180)
  • Gave |> the lowest precedence.
  • Made block constructions directly dot-accessible.
  • Made JS literal Markdown-esque. To include N `, close with N+1 `: ``` '``' ```
  • Quit reusing temporary variables.
  • File extensions like co.json, coon, or cocoon now imply --json.
  • Fixed:

0.9.0

  • Literal & is now used to reference several new targets:
    • Left hand of |> (in place of _).
    • Current item of newly added quick map: for [0 1] => &+2 # [2 3]
    • Subject of new with as proposed in #172.
  • Made cascade, now with in disguise, require at least one & in body. (#179)
  • Made let accept this = on the first assignment to substitute old with.
  • Made bodyless catch return the catchee.
  • Made by -1 implied on downward ranges.
  • Made interpolation apply to #& and #@.
  • Quit expanding super followed by :: to parent method, so that call to super::anotherMethod works as expected.
  • Fixed:

0.8.2

0.8.1

0.8.0

  • Allowed hyphenated alphabets within identifiers as alias to their upper case: encode-URI-component => encodeURIComponent
  • Added cascade. (#72
  • Changed the pipe operator to |>.
  • Revised => as another block creation operator.
  • export/import/const/var can now appear anywhere.
  • catched variables are now function-scoped. (coffee#2422)
  • Generated variables now get postfix $ rather than prefix __.

0.7.6

  • Added export const.
  • Enabled object splat within brace objects via ...:.
  • Allowed array repetition to work on slices and comprehensions.
  • Disallowed malformed hex/unicode escape sequence in string.
  • Quit overloading + for array concatenation.
  • class can be bodyless again.
  • super no longer auto-.calls more than once.

0.7.5

  • Implemented implements. (#144)
  • Top-level voids are now simply ignored and usable like Python's pass.

0.7.4

  • Added import declaration in place of the implicit this import: import a, b => this <<< a <<< b
  • Made super work in accessor methods.
  • Disallowed redeclarations via var.
  • Improved handling of nonexistent files.

0.7.3

  • Node.js 0.8.x.
  • Added const and var. (#139)
  • Made function variables read-only.
  • Removed -n shorthand for --nodejs. (#142)
  • Bug fixes:
    • super with nested classes and methods
    • f a, while b then c etc.
    • and others: #138 #141 #143

0.7.2

  • Revised accessor. (#5)
  • Allowed implicit array after some unary operators.
  • Added named backcall: <-:f g => g(:f ->)
  • Made {[q]:p} short for {p: [q]:p}.

0.7.1

  • Added export statement. (#121)
  • Made {{q}:p} short for {p: {q}:p}.
  • Allowed keyword literals as object shorthand: {true} => {true: true}
  • Allowed decimals and $ in number comments.
  • Removed uppercase radix prefixes and exponential notation as per coffee#2061.
  • Labelling a function (literal or IIFE sugar) now names it. E.g. :f -> compiles to (function f(){}).
  • super call to a bound class now works as expected.
  • All compiler-generated variables are now double-underscore prefixed.
  • --interactive no longer implies --bare. Use -bi when you want top-level variables to persist.

0.7.0

  • Caught up Node.js 0.6.x.
  • ! against function/backcall now suppresses its auto-return.
  • superclass now points to the constructor that the class extends.
  • super now relies solely on superclass rather than requiring special forms like C::m = ->.
  • of no longer delegates to Array::indexOf, making it consistent with for-of behavior.
  • Inline implicit objects now close at newline or if/for/while/until.
  • --print no longer implies --compile.
  • --watch now works on Windows.

0.6.7

0.6.6

  • Added unary assignments: !! = x => x = !!x
  • Made a? <<< b short for a <<< b if a?.
  • Improved stack traces from directly run .co files.

0.6.5

  • case/of/instanceof now works better with array slice.
  • instanceof now rejects invalid right operands.

0.6.4

  • Unary operators now spread into an array operand: +[a, b] => [+a, +b]
  • .. now points to the constructor under class.
  • coke now works from subdirectories. (coffee#1687)

0.6.3

  • Added pipe operator: f! => g _ => _ = f!; g _
  • Fixed identifier lexing as per ES5.
  • Improved label handlings.
  • Helper functions are now declared last. (coffee#1638)

0.6.2

  • Added character ranges: [\a to \d] => [\a \b \c \d]
  • Added named destructuring: {p, q}:o = f! => o = f!; {p, q} = o
  • Numbers can no longer start with ..
  • function can no longer prefix ->/~>. Use ~function to declare bound functions instead.

0.6.1

  • Allowed line folding after for prepositions.
  • importing onto a soaked expression is now safe.
  • --json now modifies --ast or --compile.
  • Fixed #81 etc.

0.6.0

Additions

Changes

  • Added object slice.
  • Added bang call: f! => f()
  • Revised clone syntax from x{} to ^x.
  • Revised semiautovivification syntax from .!/.@ to .@/.@@.
  • Variable interpolations no longer require braces: "(#id)" => "(" + id + ")"
  • Spaced dots now close implicit calls. See coffee#1407.
  • Direct calls to super now delegate this.
  • extended hook is back.
  • from of for is now optional, meaning from 0. tilless from is no longer allowed.

0.5.4

  • while/until can now have update clause after test clause: continue while f(), g() => for (; f(); g()) {}
  • that no longer triggers anaphoric conversion under unless/until.
  • Disallowed a.=b = c p:~ (a, b) -> f ..., a etc.
  • Fixed coffee#1416.

0.5.3

  • Added do-while/until construction.
  • Added $ flag to regexes. Same as .source, but more efficient.
  • Suppressed implicit return on newed/setter functions.
  • Sped up lexer.

0.5.2

  • Added !? (inexistence) operator.
  • function no longer requires parens around parameters.
  • class block is now mandatory.
  • Bug fixes: coffee#1352 coffee#1354

0.5.1

  • a.b.c?.=d.e now works as expected.
  • a[b, c] = d now works as expected.
  • extras/coco.js works again on WSH.
  • --output implies --compile again.

0.5.0

  • Added ** operator.
  • Overloaded +/-// (in addition to *) for arrays and strings.
  • Revised let: let (a) ~> => let a then
  • Allowed underscores within number literals.
  • Major regex changes:
    • Dieted heregex: /// re /// => // re //
    • Allowed leading whitespace in normal regex literals when unambiguous.
    • No longer accepts invalid regexes.
  • -> is now optional when function is used.
  • case accepts comma-separated tests again.
  • return/throw can now take a block.
  • REPL now uses ^J to continue lines.

0.4.2

  • Enabled:
    • ADI on ?.
    • ACI on ++/--
    • conditional destructuring assignments
    • colors and tab completion in REPL
  • Made leading *s serve like list markers.

0.4.1

  • Added string/array multiplication.
  • Added label support.
  • Aliased constructor as ...

0.4.0

  • Added let. Unary do is back at being simple call.
  • Added with.
  • Added semiautovivification.
  • Made :: a pure sugar for prototype, which can now directly refer to @:: under class body.
  • ?. can now appear anywhere a normal dot can be used.
  • ~. is changed to . ~.
  • new no longer accepts splatted arguments.
  • --interactive now works with --compile and --bare.
  • Renamed --nodes option and .nodes method to --ast/.ast.
  • Fixed the performance bug wrt long method chains.
  • Quit supporting Node.js 0.3.x or lower.

0.3.2

  • Unrestricted ADI for identifiers beyond @ and ::.
  • Expanded property shorthands beyond @foo.
  • Added typeof!, which inspects the internal [[Class]] property.
  • Added shebang support.
  • REPL results now evaluate more intuitively.
  • Disallowed whitespace mixup for indentations.

0.3.1

  • debugger now works anywhere.
  • Revised heregex flag syntax: ///#{x}#{y}///? -> RegExp('' + x, y);
  • Removed Coco.eval.
  • Made extras/coco.js work as a mini-compiler on WSH.
  • Added extras/mode-coco.js, an editing mode for Ace.
  • Added --json option.

0.3.0

Pure Additions

  • Added backcall, a sugar to flatten nested callbacks.
  • do block can now work as a pair of normal parentheses.
  • Improved ACI (automatic comma insertion): f {} [] x -> f({}, [], x);
  • Improved ADI (automatic dot insertion): @@0'!' -> arguments[0]['!'];
  • Multiline block on the RHS of object property now works as an implicit array.
  • Heregexes now support dynamic flags: /// x #{? y } /// -> RegExp('x', y);
  • Enabled compound accessigns: a.+=b -> a += a.b;
  • ... in array destructuring (same as ...[]) now skips items rather than sliceing them. (coffee#870)
  • Compilation errors now report line numbers.
  • Coco object now emits more events for use with --require.

Incompatible Changes

  • => -> ~>
  • &. -> ~.
  • Braceless objects no longer consume property shorthands. (coffee#618)
  • Indentations within non-here strings are now stripped.
  • Fixed block comment syntax to good ol' /* */.
  • @0 is now this[0] rather than arguments[0].

0.2.2

  • is not is the new isnt.
  • @'++' is now valid as a shorthand for @['++'].
  • Commas between primitive values are now optional.
  • coke now automatically aliases tasks.
  • extras/coco.js now works as a Gecko JS Module.
  • Grouped documentation suite into doc/ for portability.
  • Rewrote src/optparse.co.

0.2.1

  • Added numeric ranges.
  • Destructuring assignments can now specify default values using logical operators. Default arguments syntax has been changed accordingly. ((a || b) -> instead of (a ||= b) ->)
  • do now performs special conversions against function literals with parameters, making it work as pseudo-let and Coffee 1.0.0 compliant.
  • Allowed for i from x then as a sugar for for i from 0 til x then.
  • Disallowed duplicate formal arguments.
  • Improved syntax-highlight in src/index.html.

0.2.0

  • Version bump for Xmas, in concert with Coffee 1.0.0.
  • @@ is now a shorthand for arguments.
  • do can now indicate a call against indented arguments.
  • and and or now close implicit calls, making you write even less parens: f x and g y or z -> f(x) && g(y) || z;
  • catch's variable declaration is no longer required.
  • a<[ b c ]> is now equivalent to a[\b, \c] (was a(\b, \c)).
  • case now requires brackets to have multiple conditions.
  • Added --nodejs option. See coffee#910.
  • Renamed --stdio to --stdin.

0.1.6

  • Added character/word literal: \C + \++ -> 'C' + '++';
  • Retrieving multiple properties at once is now possible: a[b, c] -> [a[b], a[c]];
  • Destructuring into an object's properties is now possible:
    • a[b, c] = d -> a[b] = d[0], a[c] = d[1];
    • a{b, c} = d -> a.b = d.b, a.c = d.c;
  • Compound assignments can now destructure: [@a, @b] /= c -> this.a /= c[0], this.b /= c[1];

0.1.5

  • Conditional control structures can now be anaphoric; that within if, while or case block now refers to the condition value.
  • Decimal numbers can now have arbitrary trailing alphabets as comments. e.g. 9times, 1.5s
  • Added <<</<<<< as aliases to import/import all
  • non-ASCII identifiers are now allowed.

0.1.4

  • . and its families can now be used with numbers and strings, instead of []. a.0.'0' compiles to a[0]['0'].
  • Added syntax for cloning objects; obj{key:val} acts like a simple version of ES5 Object.create, creating a prototypal child of obj and assigning to .key with val.
  • default arguments can now choose to use ||/&&.
  • super under a class block now refers to the superclass.
  • .coffee extension is no longer supported.

0.1.3

  • Compilation now prefers single quotes.
  • AST now compiles faster, roughly 1.4 times than 0.1.2.
  • []/{} can now be safely used as an placeholder within array destructuring.
  • Improved --nodes output.

0.1.2

  • ... is now prefix.
  • {0: first, (*-1): last} = array now works.
  • Added --lex to the coco utility. Removed --lint.
  • src/ now has doc view.

0.1.1

Release.

coco's People

Contributors

alotofnoodles avatar brodyberg avatar cehoffman avatar chrislloyd avatar dpritchett avatar drnic avatar gfodor avatar holmsand avatar hugs avatar jashkenas avatar leobm avatar matehat avatar michaelficarra avatar noonat avatar olsonjeffery avatar satyr avatar srijs avatar sstephenson avatar stanangeloff avatar tanob avatar tim-smart avatar track-com avatar trevorburnham avatar vendethiel avatar zaach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coco's Issues

implicit arrays

The property syntax is already special in allowing an indented expression as RHS:
$ coco -bpe '
> k:
> 1
> '
({
k: 1
});
But not block:
$ coco -bpe '
> k:
> 1
> 2
> '
Error: Parse error on line 3: Unexpected 'TERMINATOR'
Allowing the latter as an implicit array literal seems reasonable.

`import` shortcut

Should be able to optimize if the right operand is a bare array/object.
C:: import d: e, (f): g

var _ref;
_ref = C.prototype, _ref.d = e, _ref[f] = g;

edit: On second thought, array case is pretty pointless.

Support do (x) ->

Currently, do (x = y) -> ... compiles to

(function(x){
  x == null && (x = y);
  ...
}());

which is really just an inefficient way of writing

(function(x){
  ...
}(y));

Changing do to rewrite in this way would also allow you to write do (x = x), which currently is nonsensical, to capture a particular value of x (useful in loops).

I would also suggest that do (x) be made a shorthand for do (x = x).

bound constructor

class C
  (@attr) =>

var C;
C = (function(){
  function C(_arg){
    var _this = new _ctor;
    _this.attr = _arg;
    return _this;
  }
  C.name = "C";
  function _ctor(){}
  _ctor.prototype = C.prototype;
  return C;
}());

Enhance <<< and <<<<

Currently the import or <<< feature is handy but a version that allows for only undefined values to be imported would help I think.

Below is a common use-case:

human = (args)->
    defaults =
        height: 6
        hair: 'brown'

    args <<< defaults
    console.log args, defaults


human do
    country: 'canada'
    job: 'mail man'
    height: 3

In this example, defaults.height overrides args.height.

Maybe the syntax could be something like:

<<<?
<<<<?

I am not sold on those at all, just potentials.
Maybe we could change <<< to behave non-destructively by default. Then we could provide bang syntax to force overrides, like such:

<<<!
<<<<!

Support get/set

With syntax like:

obj = {
  prop: function -> 42
  prop: function (item) -> alert item
}

var obj;
obj = {
  get prop(){
    return 42;
  },
  set prop(item){
    return alert(item);
  }
};

fallthrough

switch task
case prepare
  do sing
  fallthrough  # prevents auto-break
default
  do dance


switch (task) {
case prepare:
sing();
default:
dance();
}

`import` aliases

  • They are kind of verbose, and don't read well when combined with other symbols (such as @:: import ...).
  • Can act as replacements after harmony defines import for real.

<<< for import, <<<< for import all?

Make `super` a literal

Now that you can super ... instead of super (which compiles to the same thing), make it a literal for greater flexibility (such as a.map super.bind this).

Make `delete` return the original value

Since the return value of JS delete is hardly useful and rarely used.
v = delete o.p
delete o.k

var _ref;
v = (_ref = o.k, delete o.k, ref);
delete o.k;

Support labels

The current workaround (L:break L;) is too awkward.

thisplat

f ...


f.apply(this, arguments);

Keep `arguments` across statement wrappers

So that this:
$ coco -e 'console.log arguments is (switch case 1 then arguments)'
false
results in true.

Before

console.log(arguments === (function(){
  switch (false) {
  case !1:
    return arguments;
  }
}.apply(this, arguments)));

After

console.log(arguments === (function(_args){
  switch (false) {
  case !1:
    return _args;
  }
}(arguments)));

numeric ranges

[1 to 3]
[1 to 5 by 2]

[1, 2, 3]
[1, 3, 5]

Should be able to expand within lexer.

Optimize `if` compilation using comma operator

ok = if cond
  expr()
  true
else
  false

Before

var ok;
ok = (function(){
  if (cond) {
    expr();
    return true;
  } else {
    return false;
  }
}());

After

var ok;
ok = cond ? (expr(), true) : false;

Make JS literal smarter

So that hacks like

`EXIT:`
for i from 3 to 5
  for j from 7 to 9
    `break EXIT` if Math.random() < .2
    say i * j

works as expected.

Speed up lexer

$ git log -1 --format=oneline
4a67699c0e66707299fe22c3311c3be35b4fe4f grammar: removed Case

$ coke bench
Lex     : 1026[ms] (18388 tokens)
Rewrite :  135[ms] (20772 tokens)
Parse   :  150[ms]
Compile :  212[ms] (119587 chars)
TOTAL   : 1523[ms]

typo in readme

Install instructions state:
git clone git:github.com/satyr/coco.git && cd coco && bin/coke i

But should be:
git clone git://github.com/satyr/coco.git && cd coco && bin/coke i

anaphoric

return that if get()


var that;
if (that = get()) {
return that;
}

`let` over `do` for scope introduction

Reasons

  • Scope mixups:

    a = 1
    say do     (a = a) -> a  # 1
    say do []= (a = a) -> a  # undefined
    
  • do being a simple sugar for () is consistent and easier to grok.

Syntax

let (a = b) -> # (function(a){})(b)
let (a) ->     # (function(a){})(a)
let (@a) ->    # (function(a){})(this.a)
let ~>         # (function(){}).call(this)

number comments

Allow arbitrary trailing alphabets, for specifying units etc.

setTimeout cb, 512ms

day = 24hours * 60seconds

Support language filters?

Would it a terrible idea to allow other languages within coco?

Here's a simple example of what I am thinking:

paragraph = 
    :markdown
    Hello, 
    ======
    Today is a *fine* day.

$('#welcome-message').inject paragraph

The :markdown is just an example of how one might signify the beginning of a new language block. I guess coco would need to have a 'hook' for authors to plugin/reference other language compilers. I imagine it wouldn't be too hard to manage that part. The issue may be more the usefulness of such a feature, and enough use-cases to make it worthwhile.

npm install coco link bin error

Apparently there is a problem with package.json. According to isaacs the bin hash should be filenames not module ids.

~ $ npm install coco --loglevel verbose npm info it worked if it ends with ok
npm verb cli [ 'install',
npm verb cli 'coco',
npm verb cli '--loglevel',
npm verb cli 'verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb config file /Users/stuarts/.npmrc
npm verb config file /Users/stuarts/local/etc/npmrc
npm verb install [ 'coco' ]
npm verb install [ 'coco' ]
npm verb install pkglist [ 'coco' ]
npm verb must install [ 'coco' ]
npm verb install coco
npm verb must install? [ [ 'coco' ], true ]
npm verb GET coco
npm verb etag "2V412V9E96NYDOLEOXV5L3HMB"
npm verb response http://registry.npmjs.org/coco npm verb etag coco from cache
npm verb Supported versions [ '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]',
npm verb Supported versions '[email protected]' ]
npm verb coco tag latest
npm verb install [email protected]
npm verb must install? [ [ 'coco', '0.3.2' ],
npm verb must install? true ]
npm verb [email protected] exact
npm verb caching /Users/stuarts/local/lib/node/.npm/.cache/coco/0.3.2/package.json
npm verb install list [ [ 'coco', '0.3.2' ] ]
npm verb mkdir done: /Users/stuarts/local/lib/node/.npm/coco/0.3.2
npm verb unpackTar uid, gid [ undefined, undefined ]
npm verb success gzip "--decompress" "--stdout" "/Users/stuarts/local/lib/node/.npm/.cache/coco/0.3.2/package.tgz"
npm verb success tar "-mvxpf" "-" "-C" "/Users/stuarts/local/lib/node/.npm/coco/0.3.2"
npm verb unpacked, building coco,0.3.2
npm verb caching /Users/stuarts/local/lib/node/.npm/coco/0.3.2/package/package.json
npm info preinstall [email protected]
npm verb deps being resolved [ { name: 'coco',
npm verb deps being resolved description: 'Unfancy CoffeeScript',
npm verb deps being resolved keywords:
npm verb deps being resolved [ 'language',
npm verb deps being resolved 'compiler',
npm verb deps being resolved 'coffeescript',
npm verb deps being resolved 'javascript' ],
npm verb deps being resolved author:
npm verb deps being resolved { name: 'satyr',
npm verb deps being resolved email: '[email protected]',
npm verb deps being resolved url: 'http://satyr.github.com' },
npm verb deps being resolved version: '0.3.2',
npm verb deps being resolved homepage: 'http://satyr.github.com/coco/',
npm verb deps being resolved repository:
npm verb deps being resolved { type: 'git',
npm verb deps being resolved url: 'git://github.com/satyr/coco.git' },
npm verb deps being resolved licenses:
npm verb deps being resolved [ { type: 'MIT',
npm verb deps being resolved url: 'https://github.com/satyr/coco/raw/master/LICENSE' } ],
npm verb deps being resolved engines: { node: '>=0.2.6' },
npm verb deps being resolved directories: { lib: './lib', bin: './bin' },
npm verb deps being resolved main: './lib/coco',
npm verb deps being resolved bin:
npm verb deps being resolved { coco: './lib/command',
npm verb deps being resolved coke: './lib/coke' },
npm verb deps being resolved id: '[email protected]',
npm verb deps being resolved engineSupported: true,
npm verb deps being resolved npmVersion: '0.3.15',
npm verb deps being resolved nodeVersion: 'v0.4.2',
npm verb deps being resolved files: [ '' ],
npm verb deps being resolved defaultsLoaded: true,
npm verb deps being resolved dist:
npm verb deps being resolved { shasum: 'd5aff68b204e5f5f84f7db0298b2af6d2da3370e',
npm verb deps being resolved tarball: 'http://registry.npmjs.org/coco/-/coco-0.3.2.tgz' },
npm verb deps being resolved _bundledDeps: [] },
npm verb deps being resolved [] ]
npm verb linkBins [email protected]
npm verb linkBin coco ./lib/command
npm verb linkBin coke ./lib/coke
npm verb linkMans [email protected]
npm ERR! failed to link bins
npm ERR! install failed Error: ENOENT, No such file or directory '/Users/stuarts/local/bin/[email protected]'
npm info install failed rollback
npm info uninstall [ '[email protected]' ]
npm verb removing [ [ 'coco', '0.3.2' ] ]
npm verb from cache /Users/stuarts/local/lib/node/.npm/coco/0.3.2/package/package.json
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm info auto-deactive not symlink
npm verb uninstall [email protected] remove links
npm verb uninstall [email protected] remove bins
npm verb uninstall [email protected] remove public modules
npm info postuninstall [email protected]
npm verb uninstall [email protected] remove package dir
npm info uninstall [email protected] complete
npm info install failed rolled back
npm ERR! Error: ENOENT, No such file or directory '/Users/stuarts/local/bin/[email protected]'
npm ERR! Report this entire log at http://github.com/isaacs/npm/issues
npm ERR! or email it to [email protected]
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm ERR! System Darwin 10.6.0
npm ERR! argv { remain: [ 'coco' ],
npm ERR! argv cooked:
npm ERR! argv [ 'install',
npm ERR! argv 'coco',
npm ERR! argv '--loglevel',
npm ERR! argv 'verbose' ],
npm ERR! argv original:
npm ERR! argv [ 'install',
npm ERR! argv 'coco',
npm ERR! argv '--loglevel',
npm ERR! argv 'verbose' ] }
npm verb exit [ 2, true ]
npm not ok

return-if

return if get()

var _ref;
if (_ref = get()) return _ref;

Manual install leads to Error: Cannot find module './optparse'

When installing coco manually using readme instructions, the following occurs:

node.js:63
    throw e;
    ^s:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/Users/KUHRT/coco/bin/coco:20:5)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/Users/KUHRT/coco/bin/coke:11:15)
    at Module._compile (node.js:462:23)

I can overcome this by manually copying the optpase file from the lib directory to the bin directory. I also npm'd optparse but haven't tried loading the module from there (after I realized the problem code was using a local path). I see that you've symlinked the coke file to bin so I am not sure why this is happening.

Am I doing something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.