ForNeVeR / catberry-ts

An ongoing effort to create TypeScript definitions for Catberry.
0 stars 0 forks source link

Compilation error on `npm run tsdef` #31

Closed rexim closed 9 years ago

rexim commented 9 years ago

See discussion on #16

$ npm run tsdef

> catberry-ts@0.0.0 tsdef /home/rexim/Programming/mine/catberry-ts
> gulp tsdef

[00:42:10] Failed to load external module typescript-register
[00:42:10] Failed to load external module typescript-require
/home/rexim/Programming/mine/catberry-ts/gulpfile.ts:4
import gulp = require('gulp');
^^^^^^
SyntaxError: Unexpected reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Liftoff.handleArguments (/home/rexim/Programming/mine/catberry-ts/node_modules/gulp/bin/gulp.js:116:3)
    at Liftoff.<anonymous> (/home/rexim/Programming/mine/catberry-ts/node_modules/gulp/node_modules/liftoff/index.js:192:16)
    at module.exports (/home/rexim/Programming/mine/catberry-ts/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "/home/rexim/.nvm/versions/node/v0.12.4/bin/node" "/home/rexim/.nvm/versions/node/v0.12.4/bin/npm" "run" "tsdef"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! catberry-ts@0.0.0 tsdef: `gulp tsdef`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the catberry-ts@0.0.0 tsdef script 'gulp tsdef'.
npm ERR! This is most likely a problem with the catberry-ts package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp tsdef
npm ERR! You can get their info via:
npm ERR!     npm owner ls catberry-ts
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/rexim/Programming/mine/catberry-ts/npm-debug.log
$ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 17 Qiana
Release:    17
Codename:   qiana
ForNeVeR commented 9 years ago

Honestly I cannot get any fucking piece of node to work on Debian-based (Ubuntu 14.04.1) distro. Every miserable piece of javascript crying about absent node executable. And the node itself is called nodejs here. Debian is not my favorite OS.

ForNeVeR commented 9 years ago

Hm, even in that kingdom of cocksuckery I've finally managed to get this fucksmith node to work. I had the following:

$ nodejs --version
v0.10.25
$ npm --version
1.3.10

From your report it seems that you have a very outdated version of npm. Could you update that?

rexim commented 9 years ago

Ok, I'll try

rexim commented 9 years ago

Actually, my npm is not that outdated:

npm ERR! npm v2.10.1

ForNeVeR commented 9 years ago

Sorry, that was my mistake. Your npm is ok.

ForNeVeR commented 9 years ago

Could you please remove node_modules, make npm install again and post its output here?

rexim commented 9 years ago
$ npm install
npm WARN package.json catberry-ts@0.0.0 No repository field.
npm WARN package.json catberry-ts@0.0.0 No license field.
npm WARN prefer global typescript@1.4.1 should be installed with -g
npm WARN engine joi@4.9.0: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"2.11.0"})
npm WARN peerDependencies The peer dependency minichain@~0.0.1 included from minitable will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN engine topo@1.0.2: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"2.11.0"})
npm WARN prefer global tsd@0.6.0 should be installed with -g
|
> catberry-ts@0.0.0 install /home/rexim/Programming/mine/catberry-ts
> tsd reinstall -s

-> running reinstall

>> written 6 files:

    - es6-promise/es6-promise.d.ts
    - gulp-typescript/gulp-typescript.d.ts
    - gulp/gulp.d.ts
    - node/node.d.ts
    - shelljs/shelljs.d.ts
    - xml2js/xml2js.d.ts
shelljs@0.3.0 node_modules/shelljs

es6-promise@2.1.1 node_modules/es6-promise

typescript@1.4.1 node_modules/typescript

typescript-register@1.1.0 node_modules/typescript-register
├── sanitize-filename@1.3.0
└── chalk@0.5.1 (escape-string-regexp@1.0.3, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)

gulp-typescript@2.7.7 node_modules/gulp-typescript
├── source-map@0.4.2 (amdefine@0.1.1)
├── through2@0.6.5 (xtend@4.0.0, readable-stream@1.0.33)
├── gulp-util@3.0.5 (array-differ@1.0.0, beeper@1.1.0, array-uniq@1.0.2, lodash._reescape@3.0.0, lodash._reinterpolate@3.0.0, lodash._reevaluate@3.0.0, object-assign@2.1.1, replace-ext@0.0.1, minimist@1.1.1, chalk@1.0.0, vinyl@0.4.6, lodash.template@3.6.1, multipipe@0.1.2, dateformat@1.0.11)
└── vinyl-fs@1.0.0 (merge-stream@0.1.7, object-assign@2.1.1, graceful-fs@3.0.8, strip-bom@1.0.0, vinyl@0.4.6, mkdirp@0.5.1, duplexify@3.4.2, glob-stream@4.1.1, glob-watcher@0.0.8)

gulp@3.9.0 node_modules/gulp
├── pretty-hrtime@1.0.0
├── interpret@0.6.2
├── deprecated@0.0.1
├── archy@1.0.0
├── minimist@1.1.1
├── semver@4.3.6
├── tildify@1.1.0 (os-homedir@1.0.0)
├── v8flags@2.0.7 (user-home@1.1.1)
├── chalk@1.0.0 (escape-string-regexp@1.0.3, ansi-styles@2.0.1, supports-color@1.3.1, strip-ansi@2.0.1, has-ansi@1.0.3)
├── orchestrator@0.3.7 (stream-consume@0.1.0, sequencify@0.0.7, end-of-stream@0.1.5)
├── liftoff@2.1.0 (extend@2.0.1, rechoir@0.6.1, flagged-respawn@0.3.1, resolve@1.1.6, findup-sync@0.2.1)
├── gulp-util@3.0.5 (array-differ@1.0.0, beeper@1.1.0, array-uniq@1.0.2, lodash._reescape@3.0.0, lodash._reinterpolate@3.0.0, lodash._reevaluate@3.0.0, object-assign@2.1.1, replace-ext@0.0.1, vinyl@0.4.6, lodash.template@3.6.1, through2@0.6.5, multipipe@0.1.2, dateformat@1.0.11)
└── vinyl-fs@0.3.13 (graceful-fs@3.0.8, strip-bom@1.0.0, defaults@1.0.2, vinyl@0.4.6, mkdirp@0.5.1, through2@0.6.5, glob-stream@3.1.18, glob-watcher@0.0.6)

xml2js@0.4.8 node_modules/xml2js
├── sax@0.6.1
└── xmlbuilder@2.6.4 (lodash@3.9.3)

tsd@0.6.0 node_modules/tsd
├── assertion-error@1.0.0
├── deep-freeze@0.0.1
├── joi-assert@0.0.3
├── type-detect@0.1.2
├── rimraf@2.2.8
├── open@0.0.5
├── jsesc@0.5.0
├── lru-cache@2.5.2
├── ministyle@0.1.4
├── minimist@1.1.1
├── uuid@2.0.1
├── exit@0.1.2
├── detect-indent@0.2.0 (get-stdin@0.1.0, minimist@0.1.0)
├── json-pointer@0.2.2 (foreach@2.0.5)
├── miniwrite@0.1.4 (mkdirp@0.3.5)
├── minimatch@1.0.0 (sigmund@1.0.1)
├── minichain@0.0.1
├── minitable@0.0.3 (minichain@0.0.1)
├── semver@4.3.6
├── mkdirp@0.5.1 (minimist@0.0.8)
├── event-stream@3.1.7 (stream-combiner@0.0.4, duplexer@0.1.1, from@0.1.3, pause-stream@0.0.11, map-stream@0.1.0, split@0.2.10, through@2.3.7)
├── uri-templates@0.1.7
├── bl@0.9.4 (readable-stream@1.0.33)
├── universal-analytics@0.3.8 (async@0.2.10, node-uuid@1.4.3, underscore@1.8.3)
├── definition-header@0.1.0 (xregexp@2.0.0, parsimmon@0.5.1)
├── glob@4.5.3 (inherits@2.0.1, once@1.3.2, inflight@1.0.4, minimatch@2.0.8)
├── bluebird@1.2.4
├── lazy.js@0.3.2
├── request@2.58.0 (caseless@0.10.0, aws-sign2@0.5.0, forever-agent@0.6.1, stringstream@0.0.4, tunnel-agent@0.4.0, oauth-sign@0.8.0, isstream@0.1.2, extend@2.0.1, json-stringify-safe@5.0.1, node-uuid@1.4.3, qs@3.1.0, combined-stream@1.0.5, mime-types@2.0.14, http-signature@0.11.0, tough-cookie@2.0.0, form-data@1.0.0-rc1, hawk@2.3.1, har-validator@1.8.0)
├── update-notifier@0.2.2 (is-npm@1.0.0, semver-diff@2.0.0, string-length@1.0.0, chalk@0.5.1, latest-version@1.0.1, configstore@0.3.2)
├── verror@1.4.0 (extsprintf@1.0.3)
└── joi@4.9.0 (topo@1.0.2, isemail@1.1.1, hoek@2.14.0, moment@2.10.3)

jsdoc@3.3.0 node_modules/jsdoc
├── escape-string-regexp@1.0.3
├── strip-json-comments@1.0.2
├── taffydb@2.6.2
├── underscore@1.7.0
├── async@0.9.2
├── js2xmlparser@0.1.9
├── wrench@1.5.8
├── marked@0.3.3
├── requizzle@0.2.1 (underscore@1.6.0)
├── esprima@1.1.0-dev-harmony
└── catharsis@0.8.7 (underscore-contrib@0.3.0)
ForNeVeR commented 9 years ago

Could you please execute the following in the catberry-ts directory?

$ nodejs
> var tits = require('typescript-register');
undefined
> tits
{}

I still cannot get why it doesn't load the typescript-register for you.

rexim commented 9 years ago

Ta-Da!

$ nodejs
> var tits = require ('typescript-register');
Error: Cannot find module 'typescript-register'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at repl:1:12
    at REPLServer.self.eval (repl.js:110:21)
    at repl.js:249:20
    at REPLServer.self.eval (repl.js:122:7)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
>
rexim commented 9 years ago

Hm... Maybe I should install it globally?

ForNeVeR commented 9 years ago

It seems that you have no tits. Show me

ls node_modules

No, you shouldn't install it globally. It should be fine as-is.

rexim commented 9 years ago

No, I have them!!

$ ls node_modules 
es6-promise  gulp  gulp-typescript  jsdoc  shelljs  tsd  typescript  typescript-register  xml2js
rexim commented 9 years ago

They are simply barely visible ._.

ForNeVeR commented 9 years ago
$ ls node_modules/typescript-register/
rexim commented 9 years ago

I mean not visible for node at all =(

rexim commented 9 years ago
$ find node_modules/typescript-register 
node_modules/typescript-register
node_modules/typescript-register/node_modules
node_modules/typescript-register/node_modules/chalk
node_modules/typescript-register/node_modules/chalk/index.js
node_modules/typescript-register/node_modules/chalk/node_modules
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/index.js
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/node_modules
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/cli.js
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/package.json
node_modules/typescript-register/node_modules/chalk/node_modules/has-ansi/readme.md
node_modules/typescript-register/node_modules/chalk/node_modules/.bin
node_modules/typescript-register/node_modules/chalk/node_modules/.bin/has-ansi
node_modules/typescript-register/node_modules/chalk/node_modules/.bin/supports-color
node_modules/typescript-register/node_modules/chalk/node_modules/.bin/strip-ansi
node_modules/typescript-register/node_modules/chalk/node_modules/escape-string-regexp
node_modules/typescript-register/node_modules/chalk/node_modules/escape-string-regexp/index.js
node_modules/typescript-register/node_modules/chalk/node_modules/escape-string-regexp/package.json
node_modules/typescript-register/node_modules/chalk/node_modules/escape-string-regexp/readme.md
node_modules/typescript-register/node_modules/chalk/node_modules/ansi-styles
node_modules/typescript-register/node_modules/chalk/node_modules/ansi-styles/index.js
node_modules/typescript-register/node_modules/chalk/node_modules/ansi-styles/package.json
node_modules/typescript-register/node_modules/chalk/node_modules/ansi-styles/readme.md
node_modules/typescript-register/node_modules/chalk/node_modules/supports-color
node_modules/typescript-register/node_modules/chalk/node_modules/supports-color/index.js
node_modules/typescript-register/node_modules/chalk/node_modules/supports-color/cli.js
node_modules/typescript-register/node_modules/chalk/node_modules/supports-color/package.json
node_modules/typescript-register/node_modules/chalk/node_modules/supports-color/readme.md
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/index.js
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/node_modules
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/cli.js
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/package.json
node_modules/typescript-register/node_modules/chalk/node_modules/strip-ansi/readme.md
node_modules/typescript-register/node_modules/chalk/package.json
node_modules/typescript-register/node_modules/chalk/readme.md
node_modules/typescript-register/node_modules/sanitize-filename
node_modules/typescript-register/node_modules/sanitize-filename/.npmignore
node_modules/typescript-register/node_modules/sanitize-filename/index.js
node_modules/typescript-register/node_modules/sanitize-filename/test.js
node_modules/typescript-register/node_modules/sanitize-filename/Changelog.md
node_modules/typescript-register/node_modules/sanitize-filename/.travis.yml
node_modules/typescript-register/node_modules/sanitize-filename/package.json
node_modules/typescript-register/node_modules/sanitize-filename/AUTHORS
node_modules/typescript-register/node_modules/sanitize-filename/README.md
node_modules/typescript-register/LICENSE
node_modules/typescript-register/package.json
node_modules/typescript-register/README.md
ForNeVeR commented 9 years ago
$ cat node_modules/typescript-register/package.json
rexim commented 9 years ago
$ cat node_modules/typescript-register/package.json
{
  "name": "typescript-register",
  "version": "1.1.0",
  "description": "Extension to require TypeScript files from Node",
  "main": "index.js",
  "files": [
    "README.md",
    "LICENSE",
    "*.js"
  ],
  "scripts": {
    "compile": "tsc index.ts test/spec.ts --module commonjs --noImplicitAny",
    "coverage": "cat ./coverage/lcov.info | coveralls",
    "test": "istanbul cover node_modules/mocha/bin/_mocha",
    "typings": "tsd reinstall"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/pspeter3/typescript-register.git"
  },
  "keywords": [
    "typescript",
    "require",
    "interpret"
  ],
  "author": {
    "name": "Phips Peter"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/pspeter3/typescript-register/issues"
  },
  "homepage": "https://github.com/pspeter3/typescript-register",
  "dependencies": {
    "chalk": "^0.5.1",
    "sanitize-filename": "^1.3.0",
    "typescript": "^1.4.1"
  },
  "devDependencies": {
    "chai": "^1.10.0",
    "coveralls": "^2.11.2",
    "istanbul": "^0.3.5",
    "mocha": "^2.1.0",
    "tsd": "^0.6.0-beta.5"
  },
  "readme": "# TypeScript Register [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage][coveralls-image]][coveralls-url]\n\nExtension to require TypeScript files from Node. This project is an alternative to [typescript-require][typescript-require]. The main differences are:\n\n- Dependencies are run in the same context as the parent\n- Uses the TypeScript API as opposed to forking `tsc`\n- Caches dependencies in `/tmp/typescript-register/:your/:path/:here`\n\n## Examples\n\n### foo.ts\n\n```ts\nexport var foo = 3;\n```\n\n### bar.js\n```js\nrequire('typescript-register');\nvar foo = require('./foo');\n\nconsole.log(foo.foo);\n```\n\n## Installation\n\nInstall with npm:\n\n```\nnpm install typescript-register\n```\n\n## Configuration\n\nThere are three configuration options which are read from environment variables. The configuration options are read each time a module is required so you can programatically set them with: \n\n```js\nprocess.env[':name'] = ':value';\n```\n\nThe values are:\n\n- `TYPESCRIPT_REGISTER_EMIT_ERROR`: Whether or not emit fatal TypeScript errors\n- `TYPESCRIPT_REGISTER_USE_CACHE`: Whether or not to use previously emitted files\n- `TYPESCRIPT_REGISTER_COMPILER_OPTIONS`: The JSON stringified TypeScript compiler options\n\n## Contributing\n\nFeel free to fork and submit pull requests for the code! Please follow the existing code as an example of style and make sure that all your code passes tests.\n\n[npm-url]: https://www.npmjs.org/package/typescript-register\n[npm-image]: http://img.shields.io/npm/v/typescript-register.svg?style=flat-square\n\n[travis-url]: http://travis-ci.org/Asana/pspeter3/typescript-register\n[travis-image]: http://img.shields.io/travis/pspeter3/typescript-register/master.svg?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/pspeter3/typescript-register\n[coveralls-image]: https://img.shields.io/coveralls/pspeter3/typescript-register/master.svg?style=flat-square\n\n[typescript-require]: https://github.com/eknkc/typescript-require\n",
  "readmeFilename": "README.md",
  "_id": "typescript-register@1.1.0",
  "_from": "typescript-register@>=1.1.0 <2.0.0"
}
rexim commented 9 years ago

There are no tits even after global installation of them =(

ForNeVeR commented 9 years ago

Fuck my dick, that's pretty strange. I have slightly another typescript-register but with the same version tag.

rexim commented 9 years ago

What do you mean by slightly another?

ForNeVeR commented 9 years ago

Here is my version of it. You can compare: https://gist.github.com/ForNeVeR/2d6cd8f2bbefc8eaeaf0

ForNeVeR commented 9 years ago

Could you post yours index.js from typescript-register so we can compare?

rexim commented 9 years ago

omg https://gist.github.com/rexim/1949ec8a0dea04eb812b

ForNeVeR commented 9 years ago

Here's my index.js: https://gist.github.com/ForNeVeR/dc48265b4e6d9f37229d

rexim commented 9 years ago

Hm... Which one?

$ find typescript-register -name index.js
typescript-register/node_modules/chalk/index.js
typescript-register/node_modules/chalk/node_modules/has-ansi/index.js
typescript-register/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js
typescript-register/node_modules/chalk/node_modules/escape-string-regexp/index.js
typescript-register/node_modules/chalk/node_modules/ansi-styles/index.js
typescript-register/node_modules/chalk/node_modules/supports-color/index.js
typescript-register/node_modules/chalk/node_modules/strip-ansi/index.js
typescript-register/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js
typescript-register/node_modules/sanitize-filename/index.js
ForNeVeR commented 9 years ago

WHAT

rexim commented 9 years ago

!!!

ForNeVeR commented 9 years ago

I think we have found a fucking problem. You have no typescript-register/index.js file.

rexim commented 9 years ago

Yep, but how can it be?

ForNeVeR commented 9 years ago

It could be true if package author have published the same version twice, first time was the damaged one. And you somehow have cached it.

ForNeVeR commented 9 years ago

Maybe you even got cached some fucking version from my stupid fork of this package.

rexim commented 9 years ago

Just put your file to my node_modules. npm run tsdef works.

rexim commented 9 years ago

Yeah, maybe it's a cache. I'll try to investigate it today. Thank you very much uncle Never! :)

ForNeVeR commented 9 years ago

You could try npm cache rm typescript-register

ForNeVeR commented 9 years ago

Anyway, the problem has been solved.

rexim commented 9 years ago

Yep, it is definitely solved. Cleaning the cache helped. :)

rexim commented 9 years ago

http://www.loglist.net/quote/7969