atom / highlights

Syntax highlighter
https://atom.github.io/highlights
MIT License
530 stars 54 forks source link

npm install fails #11

Closed zeke closed 9 years ago

zeke commented 9 years ago

Warning: ENOENT, no such file or directory '/Users/z/forks/highlights/deps/language-c/grammars' Use --force to continue.

Here's the full error:

highlights master » npm i

> oniguruma@3.0.6 install /Users/z/forks/highlights/node_modules/first-mate/node_modules/oniguruma
> node-gyp rebuild

  CC(target) Release/obj.target/oniguruma/deps/onig/regcomp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regenc.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regerror.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regexec.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regext.o
  CC(target) Release/obj.target/oniguruma/deps/onig/reggnu.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regparse.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposerr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposix.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regsyntax.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regtrav.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regversion.o
  CC(target) Release/obj.target/oniguruma/deps/onig/st.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/ascii.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/big5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/cp1251.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_jp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_kr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_tw.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/gb18030.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_1.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_2.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_3.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_4.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_6.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_7.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_9.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_10.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_11.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_13.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_14.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_15.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_16.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8_r.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/mktable.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/sjis.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/unicode.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf8.o
  LIBTOOL-STATIC Release/oniguruma.a
  CXX(target) Release/obj.target/onig_scanner/src/onig-cache.o
  CXX(target) Release/obj.target/onig_scanner/src/onig-result.o
  CXX(target) Release/obj.target/onig_scanner/src/onig-reg-exp.o
  CXX(target) Release/obj.target/onig_scanner/src/onig-scanner.o
  CXX(target) Release/obj.target/onig_scanner/src/onig-scanner-worker.o
  CXX(target) Release/obj.target/onig_scanner/src/onig-searcher.o
  CXX(target) Release/obj.target/onig_scanner/src/unicode-utils-posix.o
  SOLINK_MODULE(target) Release/onig_scanner.node
  SOLINK_MODULE(target) Release/onig_scanner.node: Finished

> highlights@0.15.0 prepublish /Users/z/forks/highlights
> grunt prepublish

Running "clean" task

Running "build-grammars" task
Warning: ENOENT, no such file or directory '/Users/z/forks/highlights/deps/language-c/grammars' Use --force to continue.

Aborted due to warnings.

npm ERR! Darwin 13.3.0
npm ERR! argv "node" "/Users/z/.nvm/v0.10.31/bin/npm" "i"
npm ERR! node v0.10.31
npm ERR! npm  v2.2.0
npm ERR! code ELIFECYCLE
npm ERR! highlights@0.15.0 prepublish: `grunt prepublish`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the highlights@0.15.0 prepublish script 'grunt prepublish'.
npm ERR! This is most likely a problem with the highlights package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt prepublish
npm ERR! You can get their info via:
npm ERR!     npm owner ls highlights
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/z/forks/highlights/npm-debug.log

highlights master » node -v
v0.10.31

highlights master » npm -v
2.2.0
bcoe commented 9 years ago

@zeke it looks like there are a bunch of submodules required:

git submodule init
git submodule update
npm install
zeke commented 9 years ago

Thanks @bcoe. I did the git submodule dance, but was stopped in my tracks again when the build-grammars task choked on npm install:

highlights* master » npm install

> highlights@0.15.0 preinstall /Users/z/forks/highlights
> git submodule init && git submodule update

> highlights@0.15.0 prepublish /Users/z/forks/highlights
> grunt prepublish

Running "clean" task

Running "build-grammars" task
Warning: ENOTDIR, not a directory '/Users/z/forks/highlights/deps/.DS_Store/grammars' Use --force to continue.

It's trying to read .DS_Store as a directory, so I added this line:

return if packageDir is ".DS_Store"

That gets me a little further, and some passing tests, but then the shell:test task fails. My repo doesn't appear to have a ./gen directory...


highlights* master » npm i

> highlights@0.15.0 preinstall /Users/z/forks/highlights
> git submodule init && git submodule update

> highlights@0.15.0 prepublish /Users/z/forks/highlights
> grunt prepublish

Running "clean" task

Running "build-grammars" task

Running "coffeelint:gruntfile" (coffeelint) task
>> 1 file lint free.

Running "coffeelint:src" (coffeelint) task
>> 2 files lint free.

Running "coffeelint:test" (coffeelint) task
>> 1 file lint free.

Running "coffee:glob_to_multiple" (coffee) task

Running "coffeelint:gruntfile" (coffeelint) task
>> 1 file lint free.

Running "coffeelint:src" (coffeelint) task
>> 2 files lint free.

Running "coffeelint:test" (coffeelint) task
>> 1 file lint free.

Running "shell:test" (shell) task
FFFFFF

Highlights
  when an includePath is specified
    it includes the grammar when the path is a file
      Error: ENOENT, no such file or directory '/Users/z/forks/highlights/gen/grammars.json'
        at Object.fs.openSync (fs.js:438:18)
        at Object.fs.readFileSync (fs.js:289:15)
        at Highlights.module.exports.Highlights.loadGrammarsSync (/Users/z/forks/highlights/src/highlights.coffee:28:5)
        at Highlights.module.exports.Highlights.highlightSync (/Users/z/forks/highlights/src/highlights.coffee:46:6)
        at [object Object].<anonymous> (/Users/z/forks/highlights/spec/highlights-spec.coffee:8:25)
    it includes the grammars when the path is a directory
      Error: ENOENT, no such file or directory '/Users/z/forks/highlights/gen/grammars.json'
        at Object.fs.openSync (fs.js:438:18)
        at Object.fs.readFileSync (fs.js:289:15)
        at Highlights.module.exports.Highlights.loadGrammarsSync (/Users/z/forks/highlights/src/highlights.coffee:28:5)
        at Highlights.module.exports.Highlights.highlightSync (/Users/z/forks/highlights/src/highlights.coffee:46:6)
        at [object Object].<anonymous> (/Users/z/forks/highlights/spec/highlights-spec.coffee:13:25)
    it overrides built-in grammars
      Error: ENOENT, no such file or directory '/Users/z/forks/highlights/gen/grammars.json'
        at Object.fs.openSync (fs.js:438:18)
        at Object.fs.readFileSync (fs.js:289:15)
        at Highlights.module.exports.Highlights.loadGrammarsSync (/Users/z/forks/highlights/src/highlights.coffee:28:5)
        at Highlights.module.exports.Highlights.highlightSync (/Users/z/forks/highlights/src/highlights.coffee:46:6)
        at [object Object].<anonymous> (/Users/z/forks/highlights/spec/highlights-spec.coffee:18:25)
  highlightSync
    it returns an HTML string
      Error: ENOENT, no such file or directory '/Users/z/forks/highlights/gen/grammars.json'
        at Object.fs.openSync (fs.js:438:18)
        at Object.fs.readFileSync (fs.js:289:15)
        at Highlights.module.exports.Highlights.loadGrammarsSync (/Users/z/forks/highlights/src/highlights.coffee:28:5)
        at Highlights.module.exports.Highlights.highlightSync (/Users/z/forks/highlights/src/highlights.coffee:46:6)
        at [object Object].<anonymous> (/Users/z/forks/highlights/spec/highlights-spec.coffee:24:25)
    it uses the given scope name as the grammar to tokenize with
      Error: ENOENT, no such file or directory '/Users/z/forks/highlights/gen/grammars.json'
        at Object.fs.openSync (fs.js:438:18)
        at Object.fs.readFileSync (fs.js:289:15)
        at Highlights.module.exports.Highlights.loadGrammarsSync (/Users/z/forks/highlights/src/highlights.coffee:28:5)
        at Highlights.module.exports.Highlights.highlightSync (/Users/z/forks/highlights/src/highlights.coffee:46:6)
        at [object Object].<anonymous> (/Users/z/forks/highlights/spec/highlights-spec.coffee:29:25)
    it uses the best grammar match when no scope name is specified
      Error: ENOENT, no such file or directory '/Users/z/forks/highlights/gen/grammars.json'
        at Object.fs.openSync (fs.js:438:18)
        at Object.fs.readFileSync (fs.js:289:15)
        at Highlights.module.exports.Highlights.loadGrammarsSync (/Users/z/forks/highlights/src/highlights.coffee:28:5)
        at Highlights.module.exports.Highlights.highlightSync (/Users/z/forks/highlights/src/highlights.coffee:46:6)
        at [object Object].<anonymous> (/Users/z/forks/highlights/spec/highlights-spec.coffee:34:25)

Finished in 0.09 seconds
6 tests, 6 assertions, 6 failures, 0 skipped

Warning: Command failed:  Use --force to continue.

Aborted due to warnings.

npm ERR! Darwin 13.3.0
npm ERR! argv "node" "/Users/z/.nvm/v0.10.31/bin/npm" "i"
npm ERR! node v0.10.31
npm ERR! npm  v2.2.0
npm ERR! code ELIFECYCLE
npm ERR! highlights@0.15.0 prepublish: `grunt prepublish`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the highlights@0.15.0 prepublish script 'grunt prepublish'.

@kevinsawicki any idea why this gen directory is missing? I'll gladly submit a PR once I finish smoothing out these kinks.

kevinsawicki commented 9 years ago

any idea why this gen directory is missing? I'll gladly submit a PR once I finish smoothing out these kinks.

I would guess because of return if packageDir is ".DS_Store", you probably want `continue if packageDir is ".DS_Store" instead.

kevinsawicki commented 9 years ago

Added more forgiving file/folder checks so it shouldn't bail on files like .DS_Store anymore, thanks for reporting this.