Vimium: build failure

Created on 7 May 2018  路  10Comments  路  Source: philc/vimium

I am using these command to build it:
npm install --save-dev coffeescript cake build
But fail with following output
`npm WARN saveError ENOENT: no such file or directory, open '/Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/package.json'
npm WARN vimium No description
npm WARN vimium No repository field.
npm WARN vimium No README data
npm WARN vimium No license field.

  • [email protected]
    updated 1 package in 0.568s
    /Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/node_modules/coffeescript/lib/coffeescript/optparse.js:147
    shortFlag = shortFlag != null ? shortFlag.match(SHORT_FLAG)[1] : void 0;
    ^

TypeError: Cannot read property '1' of null
at buildRule (/Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/node_modules/coffeescript/lib/coffeescript/optparse.js:147:64)
at /Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/node_modules/coffeescript/lib/coffeescript/optparse.js:119:22
at buildRules (/Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/node_modules/coffeescript/lib/coffeescript/optparse.js:122:7)
at new OptionParser (/Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/node_modules/coffeescript/lib/coffeescript/optparse.js:27:20)
at Object.exports.run (/Users/yhuang/Dropbox/myproject/git/firefox/philc/vimium/node_modules/coffeescript/lib/coffeescript/cake.js:73:14)
at Object. (/usr/local/lib/node_modules/coffeescript/bin/cake:22:42)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:617:3

`

Most helpful comment

@yhuangatimvucom npm i -g [email protected]

All 10 comments

It looks like you are trying to install Vimium as an npm package, but Vimium is not an npm package.

The build instructions are here.

I'm trying to install vimium 5745bb344959a61297fc16e00bb6de0a2a8744d9 on Xubuntu 18.04, following the build instructions, and hit a similar (if not the same) error:

+paulo:~/src/vimium$ cake build
/home/paulo/node_modules/coffeescript/lib/coffeescript/optparse.js:147
    shortFlag = shortFlag != null ? shortFlag.match(SHORT_FLAG)[1] : void 0;
                                                               ^

TypeError: Cannot read property '1' of null
    at buildRule (/home/paulo/node_modules/coffeescript/lib/coffeescript/optparse.js:147:64)
    at /home/paulo/node_modules/coffeescript/lib/coffeescript/optparse.js:119:22
    at buildRules (/home/paulo/node_modules/coffeescript/lib/coffeescript/optparse.js:122:7)
    at new OptionParser (/home/paulo/node_modules/coffeescript/lib/coffeescript/optparse.js:27:20)
    at Object.exports.run (/home/paulo/node_modules/coffeescript/lib/coffeescript/cake.js:73:14)
    at Object.<anonymous> (/home/paulo/node_modules/coffeescript/bin/cake:22:42)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
    at startup (internal/bootstrap/node.js:228:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:575:3)

Here's how I installed coffeescript:

+paulo:~$ npm install coffeescript
npm WARN saveError ENOENT: no such file or directory, open '/home/paulo/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/paulo/package.json'
npm WARN paulo No description
npm WARN paulo No repository field.
npm WARN paulo No README data
npm WARN paulo No license field.

+ [email protected]
added 1 package in 0.51s

I added _~/node_modules/.bin_ to PATH. Here's coffee version:

+paulo:~$ coffee --version
CoffeeScript version 2.3.0

I also tried to install coffeescript globally (sudo npm install --global coffeescript), as suggested in http://coffeescript.org, but cake build hit exactly the same error.

I can't be sure if the issue lies with _vimium/Cakefile_ or with coffeescript itself.

@yhuangatimvucom
@marcelpaulo
Guys you have to install coffeescript 1 (I have [email protected]) globally to make it work.

@smblott-github
Why don't we use any dependency management to build Vimium? I believe that install packages globally (and manually) is a bad practice.

Why don't we use any dependency management to build Vimium?

No reason, I think. Just nobody's done it.

@smblott-github I've opened https://github.com/philc/vimium/issues/2869 some time ago but didn't get any response. Shall I make PR?

@ris58h... Sure.

However, when we cake build, the local version of cake and coffee is unlikely to be on the user's $PATH. Is there an easy way around that?

Bingo, @ris58h: installed Ubuntu package coffeescript, which is at version 1.12.7 in Ubuntu 18.04, and I could build vimium ! Thanks for the tip ! One minor detail: Ubuntu package maintainers install cake as cake.coffeescript.

@smblott-github, shouldn't CONTRIBUTING mention that ? Installing from http://coffeescript.org won't work because it installas the latest version, which is now 2.3.0.

Guys you have to install coffeescript 1 (I have [email protected]) globally to make it work.
@ris58h How to ?
I am in mac, the command I used is "npm install --global coffeescript"

@yhuangatimvucom npm i -g [email protected]

npm i -g [email protected]

Good one ! I didn't know you could specify the version when installing. I was using npm install coffeescript and it installed the latest version, 2.3.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nick-s-b picture nick-s-b  路  4Comments

peter099 picture peter099  路  3Comments

jkbbwr picture jkbbwr  路  3Comments

finalfantasia picture finalfantasia  路  3Comments

haroldcarr picture haroldcarr  路  4Comments