angular-cli: Update node-sass to node-sass 4.12, otherwise ng build will fail with Node 12

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [x ] version
- [ ] doc

Is this a regression?

ng build --prod breaks on node v12 because of node-sass version < 4.12

Fix is to update node-sass to 4.12

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 24 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@angular/cli@7.3.9 and @angular-devkit/build-angular@0.13.9 are now out, which should fix this problem.

I still seem to be getting the error, I have double checked the matched versions and matched them in the package, and can confirm all node sass in the package.lock is 4.12.0

Maybe im missing something else? Or does npm audit need to update?

This is a particular issue, as most of developers on osx will install node with homebrew, if they upgrade their node version they will get the 12.1 and result is that they can not create angular project anymore. Even if it is optional, it looks like somewhere one package have node-sass as a dependency and that will cause many problem πŸ˜•

Edit: And I would add, if they try installing Yarn with homebrew, they will get node 12.1 as well by default.

node-sass is technically an optional dependency for CLI 7.x. 7.x also provides the option to use dart Sass by manually installing it within the project.

For 8.0+, the CLI has switched to using dart Sass by default with the option to use node-sass if preferred by manually installing it within the project. If using dart Sass (in either version), the fibers package will automatically be used if manually installed within the project as well.

Hi, I had the same problem. My solution was to install the LTS version of node since I was using the current version

It’s a package optional dependency (7.3.8 package.json). However, it requires several steps to not install it within a project. When creating the project, use the --skip-install option. And once the project is created, manually run yarn --ignore-optional within the project directory. npm itself is broken in regards to optional dependencies and the no-optional flag will not work (npm issue).

This is not only a build issue, but also happens when a new project is created