Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schematics CLI can't run schematic in v0.900.3 #17067

Closed
mraible opened this issue Feb 25, 2020 · 1 comment · Fixed by #17071
Closed

Schematics CLI can't run schematic in v0.900.3 #17067

mraible opened this issue Feb 25, 2020 · 1 comment · Fixed by #17071
Assignees
Labels
Milestone

Comments

@mraible
Copy link
Contributor

mraible commented Feb 25, 2020

I have a Schematics library that I package locally with npm pack. Then I create a new Angular app, install my schematic and run it.

ng new angular-app --routing --style css
cd angular-app
npm install -D ../../oktadev*.tgz
schematics @oktadev/schematics:add-auth --issuer=$issuer --clientId=$clientId
ng test --watch=false && ng e2e

With v0.900.3 of Schematics CLI, the schematics command errors with:

+ @oktadev/schematics@1.2.1
added 22 packages from 15 contributors and audited 16701 packages in 8.069s

33 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Error: Cannot find module '@oktadev/schematics/package.json'
Require stack:
- /usr/local/lib/node_modules/@angular-devkit/schematics-cli/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js
- /usr/local/lib/node_modules/@angular-devkit/schematics-cli/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.js
- /usr/local/lib/node_modules/@angular-devkit/schematics-cli/node_modules/@angular-devkit/schematics/tools/index.js
- /usr/local/lib/node_modules/@angular-devkit/schematics-cli/bin/schematics.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.resolve (internal/modules/cjs/helpers.js:80:19)

With @angular-devkit/schematics-cli@0.803.25, it works fine.

+ @oktadev/schematics@1.2.1
added 22 packages from 15 contributors and audited 16701 packages in 7.991s

33 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

    ✅️ Added '@okta/okta-angular v1.4.0' into dependencies
    🔍 Installing packages...
CREATE /src/app/auth-routing.module.ts (1261 bytes)
CREATE /src/app/home/home.component.html (180 bytes)
CREATE /src/app/home/home.component.spec.ts (964 bytes)
CREATE /src/app/home/home.component.ts (630 bytes)
CREATE /src/app/home/home.component.css (0 bytes)
CREATE /src/app/shared/okta/auth.interceptor.ts (1031 bytes)
UPDATE /src/app/app.module.ts (475 bytes)
UPDATE /package.json (1393 bytes)
UPDATE /src/app/app.component.spec.ts (1344 bytes)
UPDATE /src/app/app.component.ts (603 bytes)
added 13 packages from 13 contributors and audited 16717 packages in 6.525s

Is this a regression?

Yes, the previous version in which this bug was not present was: @angular-devkit/schematics-cli@0.803.25

Description

Schematics CLI can't run a schematic.

🔬 Minimal Reproduction

npm i -g @angular-devkit/schematics-cli
git clone https://github.com/oktadeveloper/schematics.git
cd schematics
npm i
./test-app.sh a

You'll see the error. To fix, run:

npm i -g @angular-devkit/schematics-cli@0.803.25
rm -rf apps
./test-app.sh a

This time, there will be no stack trace.

🌍 Your Environment


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.3
Node: 12.13.0
OS: darwin x64

Angular: undefined
...
Ivy Workspace: Yes

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.900.3 (cli-only)
@angular-devkit/core         9.0.3
@angular-devkit/schematics   9.0.3
@angular/cdk                 8.2.3
@schematics/angular          9.0.3
@schematics/update           0.803.21
rxjs                         6.5.4
typescript                   3.8.2
@mraible mraible changed the title Schematics CLI can't install from tarball in v0.900.3 Schematics CLI can't run schematic in v0.900.3 Feb 25, 2020
mraible pushed a commit to oktadev/schematics that referenced this issue Feb 25, 2020
@ngbot ngbot bot modified the milestone: Backlog Feb 25, 2020
@alan-agius4 alan-agius4 self-assigned this Feb 25, 2020
dgp1130 pushed a commit that referenced this issue Feb 25, 2020
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants