philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.43k stars 2.48k forks source link

build failure #3023

Open yhuangatimvucom opened 6 years ago

yhuangatimvucom commented 6 years ago

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.

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

`

smblott-github commented 6 years ago

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.

marcelpaulo commented 6 years ago

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.

+ coffeescript@2.3.0
added 1 package in 0.51s

I added _~/nodemodules/.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.

ris58h commented 6 years ago

@yhuangatimvucom @marcelpaulo Guys you have to install coffeescript 1 (I have coffeescript@1.12.7) 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.

smblott-github commented 6 years ago

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

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

ris58h commented 6 years ago

@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?

smblott-github commented 6 years ago

@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?

marcelpaulo commented 6 years ago

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.

yhuangatimvucom commented 6 years ago

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

ris58h commented 6 years ago

@yhuangatimvucom npm i -g coffeescript@1.12.7

marcelpaulo commented 6 years ago

npm i -g coffeescript@1.12.7

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.