简体   繁体   English

打字稿错误TS2688:找不到“ .AppleDouble”的类型定义文件

[英]Typescript error TS2688: Cannot find type definition file for '.AppleDouble'

I am working on a NodeJS project which uses TypeScript on my Mac with OSX 10.12.6 The project is on a network share which runs on a RPI (cannot develop local because of connected hardware on the RPI). 我正在研究一个在OSX 10.12.6的Mac上使用TypeScript的NodeJS项目,该项目位于在RPI上运行的网络共享上(由于RPI上连接了硬件,因此无法进行本地开发)。

When I run tsc -p tsconfig.json I get: 当我运行tsc -p tsconfig.json我得到:

error TS2688: Cannot find type definition file for '.AppleDouble'.

Since I am working on a network share it turns out all folders are polluted with .AppleDouble files. 由于我正在使用网络共享,因此事实证明所有文件夹都被.AppleDouble文件污染。

After removing these files using: 使用以下方法删除这些文件后:

find . -name '.AppleDouble' -print0 | xargs -0 rm -rf

I can compile without a problem. 我可以毫无问题地进行编译。 The thing is OSX keeps writing these '.AppleDouble' files to my network share. 问题是OSX不断将这些“ .AppleDouble”文件写入我的网络共享。

In older versions of OSX you could disable this by using: 在旧版本的OSX中,您可以使用以下方法禁用此功能:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

or 要么

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

However it looks like these are not working anymore in OSX 10.12. 但是,看起来这些在OSX 10.12中不再起作用。 There are tools like BlueHarvest but these do not prevent the creation but only removes them automatically. 有类似BlueHarvest的工具,但这些工具不会阻止创建,只会自动将其删除。

Does anyone know a solution in how I can either prevent the creation of .AppleDouble files on network share or make the Typescript compiler work so it ignores the .AppleDouble ? 有谁知道一种解决方案,我可以防止在网络共享上创建.AppleDouble文件,或者可以使Typescript编译器工作以使其忽略.AppleDouble吗?

My tsconfig.json: 我的tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "noImplicitAny": false,
        "sourceMap": false,
        "rootDir": "src-ts",
        "outDir": "build"
    },
    "exclude": [
        "build",
        "node_modules",
        ".AppleDouble"
    ]
}

This is not my preferred solution, but it made it at least workable: 这不是我的首选解决方案,但它至少使其可行:

It turned out I used Netatalk on my server to share my project folder over the network via AFP. 原来,我在服务器上使用Netatalk通过AFP通过网络共享我的项目文件夹。 It turns out AFP keeps writing the .AppleDouble files to the network share. 事实证明,AFP一直将.AppleDouble文件写入网络共享。

I switched to using Samba for the sharing the folder and OSX did not write any .AppleDouble files anymore to the share. 我转而使用Samba共享文件夹,OSX不再将任何.AppleDouble文件写入共享。

To remove the all .AppleDouble files recursively use: 要递归删除所有.AppleDouble文件,请使用:

find ./ -depth -name ".AppleDouble" -exec rm -Rf {} \\;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “找不到‘async’的类型定义文件。TS2688” - "Cannot find type definition file for 'async'. TS2688" Elastic Beanstalk“错误 TS2688:找不到‘节点’的类型定义文件。” - Elastic Beanstalk "error TS2688: Cannot find type definition file for 'node'." TS2688:找不到安装了@ types / node的“ node”的类型定义文件 - TS2688: Cannot find type definition file for 'node' with @types/node installed ../node_modules/ng2-ckeditor/ckbutton 中的错误。 指令.d.TS:1:23 - 错误 TS2688:找不到“ckeditor”的类型定义文件 - ERROR in ../node_modules/ng2-ckeditor/ckbutton. directive.d.TS: 1:23 - error TS2688: Cannot find type definition file for 'ckeditor' Typescript Nodejs Dockerfile:错误 TS5057:在指定目录中找不到 tsconfig.json 文件:'.' - Typescript Nodejs Dockerfile: error TS5057: Cannot find a tsconfig.json file at the specified directory: '.' 找不到“节点”的类型定义文件 - Cannot find type definition file for 'node' 构建:找不到“节点”的类型定义文件 - Build:Cannot find type definition file for 'node' ts-node-dev 遇到错误:“找不到模块'typescript'” - ts-node-dev runs into an error: "Cannot find module 'typescript'" 打字稿错误:TS2304:找不到名字'$' - typescript error: TS2304: Cannot find name '$' TypeScript 收到错误 TS2304:找不到名称“require” - TypeScript getting error TS2304: cannot find name ' require'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM