question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@nrwl/angular installs as a production dependency

See original GitHub issue

Current Behavior

Using create-nx-workspace and selecting any template that includes Angular installs @nrwl/angular under dependencies instead of devDependencies.

image

In the documentation it is shown that @nrwl/angular should be installed as a devdependency. image

This behaviour causes all kinds of (normally) devDependencies to be installed as regular dependencies. Like everything @nrwl/angular depends on, their dependencies, their dependencies and so on. image

Expected Behavior

@nrwl/angular is installed under devDependencies.

Steps to Reproduce

create-nx-workspace --preset=angular --appName=myApp --style=css --nx-cloud=false -name=ddapp

Failure Logs

None.

Environment

>  NX  Report complete - copy this into the issue template

  Node : 16.5.0
  OS   : win32 x64
  npm  : 7.21.1

  nx : Not Found
  @nrwl/angular : 12.8.0
  @nrwl/cli : 12.8.0
  @nrwl/cypress : 12.8.0
  @nrwl/devkit : 12.8.0
  @nrwl/eslint-plugin-nx : 12.8.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.8.0
  @nrwl/linter : 12.8.0
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/nx-cloud : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.8.0
  @nrwl/web : Not Found
  @nrwl/workspace : 12.8.0
  @nrwl/storybook : 12.8.0
  @nrwl/gatsby : Not Found
  typescript : 4.3.5

Additional information

This issue was noticed earlier by @eternalmatt and reported in https://github.com/nrwl/nx/issues/3618.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
Ionarucommented, Sep 3, 2021

The NgRx utilities are no doubt useful and I appreciate that they are provided by Nx, but perhaps it’s better to split those utilities off from @nrwl/angular into their own package, to not require people to install packages that have no place in a production environment.

For example @nrwl/angular depends on @nrwl/cypress which depends on @cypress/webpack-preprocessor which installs the entirety of webpack into the production environment.

0reactions
Waterstraalcommented, Mar 17, 2022

Can this issue be reopened? Like @Ionaru said running commands like npm audit or npx @cyclonedx/bom now incorrectly includes many devDependencies.

Like others said, if it is needed for ngrx utilities, these should be moved to their own package imho.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Configuration - Nx
A common scenario is having to build dependencies of a project first before building the project. This is what the "dependsOn": ["^build"] property...
Read more >
@nrwl/angular - npm Package Health Analysis | Snyk
All security vulnerabilities belong to production dependencies of direct and indirect packages. License: MIT. Security Policy: No.
Read more >
Nrwl Nx build for production missing node modules bundle
I have a Nrwl Nx repo with different apps (angular, nodejs with express) and shared libs inside. The repo was created with the...
Read more >
Setting up the local environment and workspace - Angular
This guide explains how to set up your environment for Angular development using the Angular CLI tool. It includes information about prerequisites, ...
Read more >
Getting Started with Monorepo with Nx Nrwl - Rupesh Tiwari
How are you managing dependencies among those projects? ... This will install @nrwl/angular plugin to give you tools to create angular lib ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found