DefinitelyTyped / tsd

[DEPRECATED] TypeScript Definition manager for DefinitelyTyped
Apache License 2.0
1.12k stars 135 forks source link

0.6.5 fails with Error: needs an unsigned integer 'ms' argument. #293

Closed qbolec closed 8 years ago

qbolec commented 8 years ago

When I run ./node_modules/.bin/tsd without any arguments (or --version) I get the following error:

[ERR!] cwd  : /home/matmat/projects/matmat/trunk/server/broker
[ERR!] os   : Linux 2.6.32-5-xen-amd64
[ERR!] argv : "node" "/home/matmat/projects/matmat/trunk/server/broker/node_modules/.bin/tsd"
[ERR!] node : v0.11.6
[ERR!] tsd  : 0.6.5
[ERR!] Error: needs an unsigned integer 'ms' argument.
[ERR!] CODE : undefined
[ERR!] needs an unsigned integer 'ms' argument.
[ERR!] If you need help, you may report this error at:
    https://github.com/DefinitelyTyped/tsd/issues

[ERR!]
TypeError: needs an unsigned integer 'ms' argument.
    at req_ (/home/matmat/projects/matmat/trunk/server/broker/node_modules/tsd/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/node_modules/natives/index.js:102:12)
    at Object.req [as require] (/home/matmat/projects/matmat/trunk/server/broker/node_modules/tsd/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/node_modules/natives/index.js:49:10)
    at Object.<anonymous> (/home/matmat/projects/matmat/trunk/server/broker/node_modules/tsd/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/fs.js:1:99)
    at Module._compile (module.js:450:26)
    at Object.Module._extensions..js (module.js:468:10)
    at Module.load (module.js:350:32)
    at Function.Module._load (module.js:306:12)
    at Module.require (module.js:358:17)
    at require (module.js:374:17)
    at Object.<anonymous> (/home/matmat/projects/matmat/trunk/server/broker/node_modules/tsd/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/graceful-fs.js:3:27)

[ERR!] tsd.json: {"version":"v4","repo":"borisyankov/DefinitelyTyped","ref":"master","path":"typings","bundle":"typings/tsd.d.ts","installed":{"hashmap/hashmap.d.ts":{"commit":"78d36dd49b6b55b9fdfe61776a12bf05c8b07777"},"mocha/mocha.d.ts":{"commit":"78d36dd49b6b55b9fdfe61776a12bf05c8b07777"},"chai/chai.d.ts":{"commit":"5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff"},"assertion-error/assertion-error.d.ts":{"commit":"5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff"},"serve-static/serve-static.d.ts":{"commit":"78ba6e41543e5ababbd1dda19797601be3c1f304"},"mime/mime.d.ts":{"commit":"78ba6e41543e5ababbd1dda19797601be3c1f304"},"express/express.d.ts":{"commit":"78ba6e41543e5ababbd1dda19797601be3c1f304"},"node/node.d.ts":{"commit":"78ba6e41543e5ababbd1dda19797601be3c1f304"},"lodash/lodash.d.ts":{"commit":"c3ab375b371b7b4204adee3b1209baecd81cec02"},"body-parser/body-parser.d.ts":{"commit":"c3ab375b371b7b4204adee3b1209baecd81cec02"},"q/Q.d.ts":{"commit":"5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff"},"promises-a-plus/promises-a-plus.d.ts":{"commit":"5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff"},"chai-as-promised/chai-as-promised.d.ts":{"commit":"5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff"},"form-data/form-data.d.ts":{"commit":"11322524f8db9cdb921427cad84cd22fe2d4f965"},"request-promise/request-promise.d.ts":{"commit":"11322524f8db9cdb921427cad84cd22fe2d4f965"},"request/request.d.ts":{"commit":"11322524f8db9cdb921427cad84cd22fe2d4f965"},"bluebird/bluebird.d.ts":{"commit":"11322524f8db9cdb921427cad84cd22fe2d4f965"},"nconf/nconf.d.ts":{"commit":"11322524f8db9cdb921427cad84cd22fe2d4f965"},"morgan/morgan.d.ts":{"commit":"78ba6e41543e5ababbd1dda19797601be3c1f304"}}}

[ERR!] .tsdrc could not be retrieved

[ERR!] Please include the following file with any support request:
    /home/matmat/projects/matmat/trunk/server/broker/tsd-debug.log

I do not know what to do. I have a similary configured (same version of npm and node) machine which works fine. I suspect some network-related issues, but the error message above seems rather unhelpful to me.

johnnyreilly commented 8 years ago

Tsd is deprecated. Take a look at Typings

qbolec commented 8 years ago

For the record in hope it will help someone in similar situation:

The problem was in that tsd depends on update-notifier which depends on configstore which depends on "graceful-fs": "^3.0.1". While the code runs fine with graceful-fs@3.0.8 it fails with graceful-fs@3.0.11, probably because of some bug introduced in natives (another modul on which graceful-fs@3.0.11 depends) in the line

      fn = runInThisContext(source, nm.filename, true);

The solution for me was to invoke npm shrinkwrap --dev on my working production server to freeze all the versions of all the (sub)dependencies of my project, and commit the generated npm-shrinkwrap.json. Then on the not working server, checkout this file and do rm -r node_modules; npm install.