Skip to content

Release 7.1.0 pulls in node-sass as a required dependency (though @angular-devkit/build-angular) #13075

Closed

Description

@kdekooter

According to GitHub, the node-sass dependency is declared optional in the build-angular package (see https://github.com/angular/angular-cli/blob/v7.1.0/packages/angular_devkit/build_angular/package.json#L56).

However if you npm install version 7.1.0 you get build-angular package version 0.11.0 with node-sass required.

As node-sass requires native libraries this breaks builds in CI systems, even is SASS is not used at all in the application code.

Angular CLI: 7.1.0
Node: 11.2.0
OS: darwin x64
Angular: 7.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.11.0
@angular-devkit/build-angular     0.11.0
@angular-devkit/build-optimizer   0.11.0
@angular-devkit/build-webpack     0.11.0
@angular-devkit/core              7.1.0
@angular-devkit/schematics        7.1.0
@ngtools/webpack                  7.1.0
@schematics/angular               7.1.0
@schematics/update                0.11.0
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.23.1

Activity

  1. alan-agius4 commented on Nov 28, 2018

    @alan-agius4
    Collaborator

    Hi, node-sass is optional in @angular-devkit/build-angular@0.11.0 https://unpkg.com/@angular-devkit/build-angular@0.11.0/package.json

    I tried locally, and it seems that if node-sass fails the installation continues as expected.

    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.10.0 (node_modules\node-sass):
    

    Can you provide the actual error message?

  2. kdekooter commented on Nov 28, 2018

    @kdekooter
    Author

    After a fresh install with the latest angular-cli node-sass in ./node_modules/@angular-devkit/build-angular/package.json is not optional, it is in the required dependencies.

  3. alan-agius4 commented on Nov 28, 2018

    @alan-agius4
    Collaborator

    I spotted the issue on npm install, it's being added as a non optional,

  4. alan-agius4 commented on Nov 28, 2018

    @alan-agius4
    Collaborator

    That said that is the norm, as on npm install at least for version 6.4.1, optionalDependencies get added to the dependencies. When failing however this should not terminate the installation.

    This is happening for all packages.

  5. clydin commented on Nov 28, 2018

    @clydin
    Member

    node-sass has a post install step that tries to download prebuilt binaries for the target platform and if that fails then tries to compile for that platform. If the compilation fails, the entire installation can fail.

    @kdekooter Please fill in the template, without the necessary version and platform information it is incredibly difficult to assist with a problem.

    npm install also has a no-optional flag.

  6. changed the title [-]Release 7.1.0 does not contain the right @angular-devkit/build-angular[/-] [+]Release 7.1.0 pulls in node-sass as a required dependency (though @angular-devkit/build-angular)[/+] on Nov 29, 2018
  7. kdekooter commented on Nov 29, 2018

    @kdekooter
    Author

    no-optional fixes things for my CI-scenario. Closing the issue.

  8. szellcsaba commented on Apr 10, 2019

    @szellcsaba

    Bumping this up.

    • removed node_modules
    • removed package_lock.json
    • npm cache clean --force

    When I try to update the angular 7.1.1 project with npm install --no-optional it installs node-sass as well. I don't use sass for any purpose in the project, how can I get rid of it?

    C:\project>npm install --no-optional
    
    > node-sass@4.11.0 install C:\project\node_modules\node-sass
    > node scripts/install.js
    
    Cached binary found at C:\Users\szellcs\AppData\Roaming\npm-cache\node-sass\4.11.0\win32-x64-64_binding.node
    
    > node-sass@4.11.0 postinstall C:\project\node_modules\node-sass
    > node scripts/build.js
    
    Binary found at C:\project\node_modules\node-sass\vendor\win32-x64-64\binding.node
    Testing binary
    Binary is fine
    
  9. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions