首页 > 解决方案 > SASS 编译器失败,退出代码为 1

问题描述

当我得到以下信息时,我正在关注 NativeScript/Angular 的官方入门并处理tns run android存储库:

从 /Projects/course-exercise-files-nativescript-angular-getting-started-guide/chapter2/02_07_end/Groceries/hooks/before-watch/nativescript-dev-sass.js 执行观察前挂钩 找到对等节点-sass 否找到输入文件。

SASS 编译器失败,退出代码为 1

我的节点版本是:Mac OS Mojave 上的 10.15.1 10.14.2

这是我的 package.json :

{
  "nativescript": {
    "id": "org.nativescript.Groceries",
    "tns-android": {
      "version": "5.0.0"
    },
    "tns-ios": {
      "version": "5.0.0"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "7.0.0",
    "@angular/common": "7.0.0",
    "@angular/compiler": "7.0.0",
    "@angular/core": "7.0.0",
    "@angular/forms": "7.0.0",
    "@angular/http": "7.0.0",
    "@angular/platform-browser": "7.0.0",
    "@angular/platform-browser-dynamic": "7.0.0",
    "@angular/router": "7.0.0",
    "nativescript-angular": "7.0.0",
    "nativescript-theme-core": "1.0.4",
    "reflect-metadata": "0.1.10",
    "rxjs": "6.3.0",
    "tns-core-modules": "5.0.2",
    "zone.js": "0.8.4"
  },
  "devDependencies": {
    "@nativescript/schematics": "~0.4.0",
    "codelyzer": "~4.5.0",
    "nativescript-dev-sass": "~1.6.0",
    "nativescript-dev-typescript": "~0.7.0",
    "nativescript-dev-webpack": "~0.18.0",
    "tslint": "~5.11.0",
    "typescript": "^3.1.6",
    "@angular/compiler-cli": "~7.0.0",
    "@ngtools/webpack": "~7.0.0"
  },
  "readme": "NativeScript Application"
}

我尝试了很多关于其他问题讨论的建议,但没有成功。

标签: nativescriptangular2-nativescript

解决方案


只有当您的项目中甚至没有一个 SCSS 文件时,您才会看到该错误。将至少一个 SCSS 文件添加到您的项目中,错误应该会消失。


推荐阅读