You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WebStorm中Angular-NativeScript标签与属性未被识别的问题排查

解决WebStorm不识别NativeScript标签/属性的问题
  • 检查项目依赖是否完整
    确保package.json中已安装@nativescript/angular和@nativescript/types,如果缺失,在项目根目录执行:

    npm install @nativescript/angular @nativescript/types --save-dev
    

    同时打开tsconfig.json,确认compilerOptions.types数组包含nativescript和@nativescript/angular,示例:

    "compilerOptions": {
      "types": ["nativescript", "@nativescript/angular"]
    }
    
  • 切换到项目本地TypeScript版本
    打开WebStorm的设置(Settings/Preferences)→ 语言与框架(Languages & Frameworks)→ TypeScript,选择「Use TypeScript from node_modules」,避免使用WebStorm内置的TS版本导致兼容问题。

  • 重新索引项目缓存
    点击顶部菜单「File」→「Invalidate Caches...」,勾选「Clear file system cache and local history」后重启WebStorm,让编辑器重新加载项目的类型定义文件。

  • 确认NativeScript插件状态
    进入设置(Settings/Preferences)→ 插件(Plugins),搜索「NativeScript」,确保插件处于启用状态,若已禁用则重新启用并重启编辑器。

内容的提问来源于stack exchange,提问作者Mint

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 16:52:32