Tsd: `tsd install` 有时会失败并显示错误:缓存文件上的 ENOENT

创建于 2015-09-03  ·  7评论  ·  资料来源: DefinitelyTyped/tsd

有时,我们的日常构建会因ENOENT错误而失败。 tsd 尝试打开一个不存在的缓存文件。

[ERR!] 错误:ENOENT,打开'C:\Users***\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36'。

在 package.json 中,我们添加了命令“./node_modules/.bin/tsd install”以在 npm-install 后自动运行。

tsd-debug.log:
[错误!] cwd : c: *[ERR!]操作系统:Windows_NT 6.2.9200[错误!] argv : "node" "c:* _node_modules\tsd\build\cli.js" "install"[错误!] 节点:v0.10.33[错误!] tsd:0.6.4[ERR!] 错误:ENOENT,打开“C:\Users* _\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36”[错误!] 代码:ENOENT[错误!] ENOENT,打开'C:\Users* \AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36.raw'
tsd本身很可能不是问题
并且与 tsd 无法找到文件有关。

[呃!]
错误:ENOENT,打开'C:\Users***\AppData\Roaming\tsd-cache\borisyankov-DefinitelyTyped\git-raw-fmt1.0\fa\fac3185ed76eb7238c79967983952cc5224e8d36.raw'

[错误!] tsd.json: {"version":"v4","re​​po":"borisyankov/DefinitelyTyped","re​​f":"master","path":"typings","bundle":"typings/ tsd.d.ts","已安装":{"jquery/jquery.d.ts":{"commit":"0de1592ef9e3144b925287ca0494f621e12b01c6"},"angularjs/angular.d.ts":{"6adae40bdc50dc8d2d8d2d8d2d8d2d8d50d25d5d2d5d5d28d5" },“ angularjs / angular-route.d.ts”:{“ commit”:“ 76e1dedf0bada455c0b75abeec3206d3aa5bd892”},“ requirejs / require.d.ts”:{“ commit”:“ 76e1dedf0bada455c0b75abeec3206dydom” ready“ dom.read .ts":{"commit":"76e1dedf0bada455c0b75abeec3206d3aa5bd892"},"modernizr/modernizr.d.ts":{"commit":"f6c8ca47193fb679479493.ui-a377193fb679479493.ui-a31077944a.uu-e-routeang-acu-e-routeang-ac-e-routeang-a37107".ts":{"commit":"76e1dedf0bada455c0b75abeec3206d3aa5bd892"},"modernizr/modernizr.d.ts":{"commit":"76e1dedf0bada455c0b75abeec3206d3aa5bd892"} ":{"commit":"53439c5a40339b54d926b32e51c738b69b83660d"},"angular-translate/angular-translate.d.ts":{"commit":"38fb591c6eba840e10b32e51c738b69b83660d"} {“ commit”:“ 38fb591c6eba840e0b53d1110302b8e4fb04651c”},“ cordova-ionic / plugins / keyboard.d.ts”:{“ commit”:“” 38fb591c6eba840e0b53d1110302b8e4fb04651c“},” cordova-ionic / plugins / keyboard.d.ts“ dova/cordova.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Camera.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"}:{"commit":"38fb591c60eba530a1c60eba530400000c60eba5340d ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/FileTransfer.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"}:{"commit":"38fb591c6eba840e0b53d110302b8e4fb04651c"} “:” 38fb591c6eba840e0b53d1110302b8e4fb04651c “},” 科尔多瓦/插件/ Splashscreen.d.ts “:{” 提交 “:” 38fb591c6eba840e0b53d1110302b8e4fb04651c “},” 科尔多瓦/插件/ FileSystem.d.ts “:{” 提交 “:” 38fb591c6eba840e0b53d1110302b8e4fb04651c“} ,"cordova/plugins/Contacts.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Media.d.ts":{"commit":"36fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Media.d.ts":{"commit":"38fb591c6eba840e0b53d1110302 StatusBar.d.ts“:{” commit“:” 38fb591c6eba840e0b53d1110302b8e4fb04651c“},” cordova / plugins / NetworkInformation.d.ts“:{” commit“:” 38fb591c6eba840e0b53d1110302b8e4fbcor51inss,“ :{"提交":"38fb591 c6eba840e0b53d1110302b8e4fb04651c “},” 科尔多瓦/插件/ Vibration.d.ts “:{” 提交 “:” 38fb591c6eba840e0b53d1110302b8e4fb04651c “},” 科尔多瓦/插件/ MediaCapture.d.ts “:{” 提交 “:” 38fb591c6eba840e0b53d1110302b8e4fb04651c “},” 科尔多瓦/plugins/DeviceOrientation.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/Push.d.ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"}:{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"}:{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"} .ts":{"commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/WebSQL.d.ts":{"commit":"38fb591c6eba840e0b53d110302b8e4fb04651c"}:{"commit":"38fb591c6eba840e0b53d110302b8e4fb04651c"} commit":"38fb591c6eba840e0b53d1110302b8e4fb04651c"},"cordova/plugins/InAppBrowser.d.ts":{"commit":"38fb591c6eba840e0b53d210}b8e4fb04651c"}b

[ERR!] .tsdrc 无法检索

最有用的评论

我强烈建议此时不要使用 tsd。 类型现在在@types命名空间下或直接在 JS 包内发布在 npm 上。

所有7条评论

@ L6Echo您好:感谢您报告此问题。 我会调查并尝试重现该问题。

我们最近刚刚遇到了类似的事情。 还使用npm脚本启动我们的tsd reinstall ,以确保在编译之前所有依赖项都已就绪。

这是我们构建服务器的输出:

> 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

这在我们的 CI 服务器 (jenkins) 上经常发生。 我们得到与@jwcarroll 相同的输出。

仅作为另一个数据点,我们在部署过程中也会遇到这种情况。 我们大约在一两周前开始使用 TSD,并且在我们的三个夜间构建中发生了这种情况。 但是,当我登录构建机器并从同一目录运行相同的“/usr/bin/nodejs /[path-to-project]/node_modules/.bin/tsd install”以尝试诊断它时,我无法重现它和 tsd 运行良好。

[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

我每周也会在我们的 Jenkins 服务器上看到这个问题。 我们正在通过 gulp-tsd 插件利用 tsd。 永远不会在开发机器上看到这个问题。 它可能会因 ENOENT 代码或其他文件相关问题而失败。 当我去寻找有问题的文件时,它显然就在那里,这让我相信这可能是异步文件读取问题。 删除整个tsd缓存解决了一段时间的问题,然后似乎又回来了。

  [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)

关于这个案子有什么新想法吗? 我收到同样的错误

12:26:46 [FrontEnd] 错误:无法统计“/home/jenkins/.tsd-cache/borisyankov-DefinitelyTyped/git-raw-fmt1.0/58/585e78ba1ed6a3b9d25722f40429c39d.NOENTE7”这样的错误: json文件或目录,stat '/home/jenkins/.tsd-cache/borisyankov-DefinitelyTyped/git-raw-fmt1.0/58/585e78ba1ed6a3b9d25722f40429c3ba934ea79d.json'

但文件存在

# 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: -

我强烈建议此时不要使用 tsd。 类型现在在@types命名空间下或直接在 JS 包内发布在 npm 上。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

Diullei picture Diullei  ·  70评论

blakeembrey picture blakeembrey  ·  15评论

lazlojuly picture lazlojuly  ·  9评论

dreamzsiva picture dreamzsiva  ·  3评论

Makio64 picture Makio64  ·  3评论