Tsd: `tsd install` fails sometimes with Error: ENOENT on a cache file

Created on 3 Sep 2015  Â·  7Comments  Â·  Source: DefinitelyTyped/tsd

Sometimes our daily build fails with an ENOENT error. tsd tries to open a cache file, which does not exists.

[ERR!] Error: ENOENT, open 'C:\Users***\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36.raw'

In package.json we added the command "./node_modules/.bin/tsd install" to run automatically after npm-install.

tsd-debug.log:
[ERR!] cwd : c:*
[ERR!] os : Windows_NT 6.2.9200
[ERR!] argv : "node" "c:*_node_modules\tsd\build\cli.js" "install"
[ERR!] node : v0.10.33
[ERR!] tsd : 0.6.4
[ERR!] Error: ENOENT, open 'C:\Users*
_\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36.raw'
[ERR!] CODE : ENOENT
[ERR!] ENOENT, open 'C:\Users*
\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36.raw'
This is most likely not a problem with tsd itself
and is related to tsd not being able to find a file.

[ERR!]
Error: ENOENT, open 'C:\Users***\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36.raw'

[ERR!] tsd.json: {"version":"v4","repo":"borisyankov/DefinitelyTyped","ref":"master","path":"typings","bundle":"typings/tsd.d.ts","installed":{"jquery/jquery.d.ts":{"commit":"0de1592ef9e3144b925287ca0494f621e12b01c6"},"angularjs/angular.d.ts":{"commit":"76e1dedf0bada455c0b75abeec3206d3aa5bd892"},"angularjs/angular-route.d.ts":{"commit":"76e1dedf0bada455c0b75abeec3206d3aa5bd892"},"requirejs/require.d.ts":{"commit":"76e1dedf0bada455c0b75abeec3206d3aa5bd892"},"domready/domready.d.ts":{"commit":"76e1dedf0bada455c0b75abeec3206d3aa5bd892"},"modernizr/modernizr.d.ts":{"commit":"f6c8ca47193fb67947944a3170912672ac3e908e"},"angular-ui-router/angular-ui-router.d.ts":{"commit":"53439c5a40339b54d926b32e51c738b69b83660d"},"angular-translate/angular-translate.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova-ionic/cordova-ionic.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova-ionic/plugins/keyboard.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/cordova.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Camera.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Device.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/FileTransfer.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/DeviceMotion.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Splashscreen.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/FileSystem.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Contacts.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Media.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/StatusBar.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/NetworkInformation.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Dialogs.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Vibration.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/MediaCapture.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/DeviceOrientation.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Push.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Globalization.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/WebSQL.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/BatteryStatus.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/InAppBrowser.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"}}}

[ERR!] .tsdrc could not be retrieved

bug

Most helpful comment

I highly recommend not using tsd at this point. Types are now published on npm under the @types namespace or inside JS packages directly.

All 7 comments

Hi @L6Echo Thank you for reporting this issue. I'll investigate and try to reproduce the problem.

We recently just ran into something similar to this. Also using an npm script to kick off our tsd reinstall in order to make sure all dependencies are in place before compilation.

Here is the output from our build server:

> tsd reinstall


-> running reinstall
[ERR!] cwd  : c:\j\vNext Dev Deploy\Foo.Web
[ERR!] os   : Windows_NT 6.3.9600
[ERR!] argv : "node" "c:\\j\\vNext Dev Deploy\\Foo.Web\\node_modules\\tsd\\build\\cli.js" "reinstall"
[ERR!] node : v0.12.4
[ERR!] tsd  : 0.6.5
[ERR!] Error: path exists but is not a directory C:\Users\jenkins\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\51
[ERR!] CODE : undefined
[ERR!] path exists but is not a directory C:\Users\jenkins\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\51
[ERR!] If you need help, you may report this error at:
    https://github.com/DefinitelyTyped/tsd/issues

[ERR!] .tsdrc could not be retrieved

[ERR!] Please include the following file with any support request:
    c:\j\vNext Dev Deploy\Foo.Web\tsd-debug.log


npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "tsd:install"
npm ERR! node v0.12.7
npm ERR! npm  v2.14.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] tsd:install: `tsd reinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] tsd:install script 'tsd reinstall'.
npm ERR! This is most likely a problem with the Foo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsd reinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls Foo
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\j\vNext Dev Deploy\Foo.Web\npm-debug.log

This happens fairly regularly on our CI server (jenkins). We get the same output as @jwcarroll.

Just to ad another data point, we also experience this during our deployment process. We started using TSD approximately one or two weeks ago and have had this occur on three of our nightly builds. However, when I log into the build machine and run the same "/usr/bin/nodejs /[path-to-project]/node_modules/.bin/tsd install" from the same directory to try and diagnose it, I cannot reproduce it and tsd has run fine.

[ERR!] cwd  : /[path-to-project]
[ERR!] os   : Linux 3.2.0-67-virtual
[ERR!] argv : "/usr/bin/nodejs" "/[path-to-project]/node_modules/.bin/tsd" "install"
[ERR!] node : v4.2.3
[ERR!] tsd  : 0.6.5
[ERR!] Error: ENOENT: no such file or directory, open '/root/.tsd-cache/DefinitelyTyped-DefinitelyTyped/git-raw-fmt1.0/a0/a01aa4eefc1319b5e8fcd210aa759ff041e23d90.raw'
[ERR!] CODE : ENOENT
[ERR!] ENOENT: no such file or directory, open '/root/.tsd-cache/DefinitelyTyped-DefinitelyTyped/git-raw-fmt1.0/a0/a01aa4eefc1319b5e8fcd210aa759ff041e23d90.raw'
This is most likely not a problem with tsd itself
and is related to tsd not being able to find a file.

[ERR!]
Error: ENOENT: no such file or directory, open '/root/.tsd-cache/DefinitelyTyped-DefinitelyTyped/git-raw-fmt1.0/a0/a01aa4eefc1319b5e8fcd210aa759ff041e23d90.raw'
    at Error (native)

[ERR!] tsd.json: {"version":"v4","repo":"DefinitelyTyped/DefinitelyTyped","ref":"master","path":"typings","bundle":"typings/tsd.d.ts","installed":{"jquery/jquery.d.ts":{"commit":"ba424f7ee39717d51c17699a09ac8df312a7e9a1"},"chosen/chosen.jquery.d.ts":{"commit":"52b0ea5c9719831eecf6ba7436660e30061a4b3c"},"core-js/core-js.d.ts":{"commit":"d0adccc436197cc7c3559322721e9df86b892bd6"},"moment/moment.d.ts":{"commit":"d28dd90af5a7ba2b4f18b107ddba3321a5a1f629"},"moment/moment-node.d.ts":{"commit":"d28dd90af5a7ba2b4f18b107ddba3321a5a1f629"},"fullCalendar/fullCalendar.d.ts":{"commit":"d28dd90af5a7ba2b4f18b107ddba3321a5a1f629"},"node/node.d.ts":{"commit":"b9a05cb4c96ae9961bbc41fbd7df9105c3b8fbd0"},"browserify/browserify.d.ts":{"commit":"b9a05cb4c96ae9961bbc41fbd7df9105c3b8fbd0"},"glob/glob.d.ts":{"commit":"b9a05cb4c96ae9961bbc41fbd7df9105c3b8fbd0"},"minimatch/minimatch.d.ts":{"commit":"b9a05cb4c96ae9961bbc41fbd7df9105c3b8fbd0"},"jsdom/jsdom.d.ts":{"commit":"b9a05cb4c96ae9961bbc41fbd7df9105c3b8fbd0"},"react/react.d.ts":{"commit":"b9a05cb4c96ae9961bbc41fbd7df9105c3b8fbd0"},"webpack/webpack.d.ts":{"commit":"ba424f7ee39717d51c17699a09ac8df312a7e9a1"}}}

[ERR!] .tsdrc could not be retrieved

[ERR!] Please include the following file with any support request:
    /[path-to-project]/tsd-debug.log

I see this issue about once a week on our Jenkins server as well. We're leveraging tsd through the gulp-tsd plugin. Never see this issue on development machines. It can fail with the ENOENT code or with another file related issue. When I go look for the offending file, it is clearly there, which leads me to believe this is possibly an async file read issue. Deleting the entire tsd cache fixes the problem for some time, then it seems to come back.

  [12:55:08] Using gulpfile D:\ws\project\web\gulpfile.js
  [12:55:08] Starting 'tsd'...
  [12:55:12] [gulp-tsd] execute command: reinstall
  [12:55:12] [gulp-tsd] config: ./tsd.json
  [12:55:12] [gulp-tsd] latest: undefined
  [12:55:12] [gulp-tsd] running...

  ---
  path exists but is not a directory C:\Users\$buildmaster722\AppData\Roaming\tsd-cache\DefinitelyTyped-DefinitelyTyped\git-raw-fmt1.0\53
  D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\async.js:93
                  throw res.e;
                  ^

EXEC : error : path exists but is not a directory C:\Users\$buildmaster722\AppData\Roaming\tsd-cache\DefinitelyTyped-DefinitelyTyped\git-raw-fmt1.0\53 [D:\ws\project\Build.xml]
      at D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\build\xm\fileIO.js:117:28
      at tryCatch1 (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\util.js:63:19)
      at Promise$_callHandler [as _callHandler] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:695:13)
      at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:711:18)
      at Promise$_settlePromiseAt [as _settlePromiseAt] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:868:14)
      at Promise$_settlePromises [as _settlePromises] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:1006:14)
      at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\async.js:74:12)
      at Async$consumeFunctionBuffer (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\async.js:37:14)
      at doNTCallback0 (node.js:407:9)
      at process._tickCallback (node.js:336:13)
D:\ws\project\Build.xml(69,3): error MSB3073: The command "gulp build" exited with code 1.
EXEC : error : path exists but is not a directory C:\Users\$buildmaster722\AppData\Roaming\tsd-cache\DefinitelyTyped-DefinitelyTyped\git-raw-fmt1.0\53 [D:\ws\project\Build.xml]
      at D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\build\xm\fileIO.js:117:28
      at tryCatch1 (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\util.js:63:19)
      at Promise$_callHandler [as _callHandler] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:695:13)
      at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:711:18)
      at Promise$_settlePromiseAt [as _settlePromiseAt] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:868:14)
      at Promise$_settlePromises [as _settlePromises] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\promise.js:1006:14)
      at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\async.js:74:12)
      at Async$consumeFunctionBuffer (D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\async.js:37:14)
      at doNTCallback0 (node.js:407:9)
      at process._tickCallback (node.js:336:13)
D:\ws\project\Build.xml(69,3): error MSB3073: The command "gulp build" exited with code 1.

[10:39:43] Using gulpfile D:\ws\project\web\gulpfile.js
  [10:39:43] Starting 'tsd'...
  [10:39:45] [gulp-tsd] execute command: reinstall
  [10:39:45] [gulp-tsd] config: ./tsd.json
  [10:39:46] [gulp-tsd] latest: undefined
  [10:39:46] [gulp-tsd] running...
  ---
  ENOENT: no such file or directory, open 'C:\Users\$buildmaster722\AppData\Roaming\tsd-cache\DefinitelyTyped-DefinitelyTyped\git-raw-fmt1.0\d7\d70d12a88d7a6b3f711dadb0fde5b3387c0a860e.raw'
  D:\ws\project\web\node_modules\gulp-tsd\node_modules\tsd\node_modules\bluebird\js\main\async.js:93
                  throw res.e;
                  ^

EXEC : error : ENOENT: no such file or directory, open 'C:\Users\$buildmaster722\AppData\Roaming\tsd-cache\DefinitelyTyped-DefinitelyTyped\git-raw-fmt1.0\d7\d70d12a88d7a6b3f711dadb0fde5b3387c0a860e.raw' [D:\ws\project\build.xml]
      at Error (native)

any new thoughts on this case? I'm getting same error

12:26:46 [FrontEnd] Error: Can't stat "/home/jenkins/.tsd-cache/borisyankov-DefinitelyTyped/git-raw-fmt1.0/58/585e78ba1ed6a3b9d25722f40429c3ba934ea79d.json": Error: ENOENT: no such file or directory, stat '/home/jenkins/.tsd-cache/borisyankov-DefinitelyTyped/git-raw-fmt1.0/58/585e78ba1ed6a3b9d25722f40429c3ba934ea79d.json'

but file exists

# stat /home/jenkins/.tsd-cache/borisyankov-DefinitelyTyped/git-raw-fmt1.0/58/585e78ba1ed6a3b9d25722f40429c3ba934ea79d.json File: ‘/home/jenkins/.tsd-cache/borisyankov-DefinitelyTyped/git-raw-fmt1.0/58/585e78ba1ed6a3b9d25722f40429c3ba934ea79d.json’ Size: 501 Blocks: 8 IO Block: 4096 regular file Device: fd00h/64768d Inode: 4485381 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1002/ jenkins) Gid: ( 1002/ jenkins) Context: unconfined_u:object_r:user_home_t:s0 Access: 2019-02-21 13:08:24.000000000 +0100 Modify: 2019-02-20 14:25:54.000000000 +0100 Change: 2019-02-21 13:08:24.838670651 +0100 Birth: -

I highly recommend not using tsd at this point. Types are now published on npm under the @types namespace or inside JS packages directly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Diullei picture Diullei  Â·  70Comments

blakeembrey picture blakeembrey  Â·  15Comments

lazlojuly picture lazlojuly  Â·  9Comments

planetoftheweb picture planetoftheweb  Â·  3Comments

jbpros picture jbpros  Â·  28Comments