GithubHelp home page GithubHelp logo

Generate library module creates a about nx HOT 8 CLOSED

nrwl avatar nrwl commented on September 26, 2024
Generate library module creates a

from nx.

Comments (8)

vsavkin avatar vsavkin commented on September 26, 2024

You are using a wrong version of the CLI in your package.json. You must use a patched version there.

Could you provide a repro?

from nx.

mgol avatar mgol commented on September 26, 2024

I've hit it as well, it doesn't matter whether you're generating a new lib or app. Repro steps:

echo '{"packageManager": "yarn"}' >~/.angular-cli.json
yarn global add @angular/cli@next # installs CLI 1.5.0-rc.3
ng new foo-bar
cd foo-bar
yarn add @nrwl/schematics --dev # installs @nrwl/schematics 0.0.7
ng generate workspace app1 --collection=@nrwl/schematics
ng generate app app2

This creates the following directory structure:

apps
├── app1
│   ├── e2e
│   │   ├── app.e2e-spec.ts
│   │   └── app.po.ts
│   └── src
│       ├── app
│       │   ├── app.component.css
│       │   ├── app.component.html
│       │   ├── app.component.spec.ts
│       │   ├── app.component.ts
│       │   └── app.module.ts
│       ├── assets
│       ├── environments
│       │   ├── environment.prod.ts
│       │   └── environment.ts
│       ├── favicon.ico
│       ├── index.html
│       ├── main.ts
│       ├── polyfills.ts
│       ├── styles.css
│       └── typings.d.ts
└── app2
    ├── apps
    │   └── app1
    │       └── src
    │           ├── app
    │           │   ├── app.component.css
    │           │   ├── app.component.html
    │           │   ├── app.component.spec.ts
    │           │   ├── app.component.ts
    │           │   └── app.module.ts
    │           ├── assets
    │           │   └── nx-logo.png
    │           ├── environments
    │           │   ├── environment.prod.ts
    │           │   └── environment.ts
    │           ├── favicon.ico
    │           ├── index.html
    │           ├── main.ts
    │           ├── polyfills.ts
    │           └── styles.css
    └── e2e
        ├── app.e2e-spec.ts
        └── app.po.ts

from nx.

sasxa avatar sasxa commented on September 26, 2024

I had this issue also. I noticed in .angular-cli.json one of my libraries included path to app1:

  "root": "libs\\lib1\\apps\\app1\\src",

After deleting this (I'm not sure when or how it was added)

  "root": "libs\\lib1\\src",

generate works normally.

ng g s abc -a lib1 -d
  create libs/lib1/src/abc.service.spec.ts (356 bytes)
  create libs/lib1/src/abc.service.ts (109 bytes)

from nx.

 avatar commented on September 26, 2024

Can confirm this still happens with Angular 5.0.0

from nx.

rmacteague avatar rmacteague commented on September 26, 2024

I have this issue as well, only happens on existing cli projects that were upgraded to a workspace. Originally created workspaces work fine.

from nx.

vsavkin avatar vsavkin commented on September 26, 2024

The issue is because you are using an unpatched version of the CLI. We point to the patched version of the CLI for this very reason. See here for more info: https://github.com/nrwl/nx/wiki/FAQ

from nx.

CharlieGreenman avatar CharlieGreenman commented on September 26, 2024

For those reading this and trying to figure out, simply modify your @angular/cli devDependencies: to look like this:
"@angular/cli": "file:.angular_cli.tgz",

The .angular_cli.tgz is generated by upgrading angular cli app to a workspace.

from nx.

github-actions avatar github-actions commented on September 26, 2024

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

from nx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.