Closed
Description
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
Reacted by Sajid Ali Mudassar and Mathias Raacke
Metadata
Metadata
Assignees
Labels
No labels
Activity
alan-agius4 commentedon Nov 28, 2018
Hi,
node-sassis optional in@angular-devkit/build-angular@0.11.0https://unpkg.com/@angular-devkit/build-angular@0.11.0/package.jsonI tried locally, and it seems that if
node-sassfails the installation continues as expected.Can you provide the actual error message?
kdekooter commentedon Nov 28, 2018
After a fresh install with the latest angular-cli node-sass in
./node_modules/@angular-devkit/build-angular/package.jsonis not optional, it is in the required dependencies.alan-agius4 commentedon Nov 28, 2018
I spotted the issue on npm install, it's being added as a non optional,
alan-agius4 commentedon Nov 28, 2018
That said that is the norm, as on
npm installat least for version6.4.1,optionalDependenciesget added to thedependencies. When failing however this should not terminate the installation.This is happening for all packages.
clydin commentedon Nov 28, 2018
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 installalso has ano-optionalflag.[-]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)[/+]kdekooter commentedon Nov 29, 2018
no-optionalfixes things for my CI-scenario. Closing the issue.szellcsaba commentedon Apr 10, 2019
Bumping this up.
When I try to update the angular 7.1.1 project with
npm install --no-optionalit installs node-sass as well. I don't use sass for any purpose in the project, how can I get rid of it?angular-automatic-lock-bot commentedon Sep 9, 2019
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.