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

reinstalling "ng new" project: yarn start error=required package: @angular-devkit/architect (via "@angular-devkit/architect") not declared #7758

Closed
laurencefass opened this issue Dec 11, 2019 · 2 comments

Comments

@laurencefass
Copy link

laurencefass commented Dec 11, 2019

Do you want to request a feature or report a bug?

critical bug

What is the current behavior?

1. install new angular project with ng new.
2. enter ng-new folder.
3. set yarn to 2.0 in folder according to: https://next.yarnpkg.com/getting-started/install
4, remove node_modules folder and any .lock files
4. run yarn install again.
5. run yarn start `( e.g. set to ng serve --host 0.0.0.0 --port 3605 --disable-host-check --public-host https://angular.syntapse.co.uk/ng-new/ in package.json)`

Result:

An unhandled exception occurred: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies

Required package: @angular-devkit/architect (via "@angular-devkit/architect")
Required by: /app/angular/ng-new/node_modules/@angular-devkit/build-angular/src/dev-server/index.js

Require stack:
- /app/angular/ng-new/node_modules/@angular-devkit/build-angular/src/dev-server/index.js
- /app/angular/ng-new/.yarn/cache/@angular-devkit-architect-npm-0.803.20-b002c42256-1.zip/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- /app/angular/ng-new/.yarn/cache/@angular-devkit-architect-npm-0.803.20-b002c42256-1.zip/node_modules/@angular-devkit/architect/node/index.js
- /app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/models/architect-command.js
- /app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/commands/serve-impl.js
- /app/angular/ng-new/.yarn/cache/@angular-devkit-schematics-npm-8.3.20-71c0eb71a3-1.zip/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /app/angular/ng-new/.yarn/cache/@angular-devkit-schematics-npm-8.3.20-71c0eb71a3-1.zip/node_modules/@angular-devkit/schematics/tools/index.js
- /app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/utilities/json-schema.js
- /app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/models/command-runner.js
- /app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/lib/cli/index.js
- /app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/lib/init.js
- /app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/bin/ng
See "/tmp/ng-EmIJni/angular-errors.log" for further details

What is the expected behavior?

yarn start should work without dependency issues on a project created with ng new which works ok with yarn v1 in normal mode.

Please mention your node.js, yarn and operating system version.

bash-4.4# yarn --version
2.0.0-rc.19
bash-4.4# node --version
v11.1.0
bash-4.4# cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.8.1
@laurencefass laurencefass changed the title ng new project: required package: @angular-devkit/architect (via "@angular-devkit/architect") not declared in dependencies ng new project: yarn start error=required package: @angular-devkit/architect (via "@angular-devkit/architect") not declared in dependencies Dec 11, 2019
@laurencefass
Copy link
Author

/tmp/ng-EmIJni/angular-errors.log

[error] Error: Could not find module "@angular-devkit/build-angular" from "/app/angular/ng-new".
    at Object.resolve (/app/angular/ng-new/.yarn/cache/@angular-devkit-core-npm-8.3.20-cc9c74017d-1.zip/node_modules/@angular-devkit/core/n$    at WorkspaceNodeModulesArchitectHost.resolveBuilder (/app/angular/ng-new/.yarn/cache/@angular-devkit-architect-npm-0.803.20-b002c42256-$    at ServeCommand.initialize (/app/angular/ng-new/.yarn/unplugged/@angular-cli-npm-8.3.20-0750f884fd/node_modules/@angular/cli/models/arc$    at process._tickCallback (internal/process/next_tick.js:43:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:763:11)
    at startup (internal/bootstrap/node.js:308:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)

@laurencefass laurencefass changed the title ng new project: yarn start error=required package: @angular-devkit/architect (via "@angular-devkit/architect") not declared in dependencies reinstalling "ng new" project: yarn start error=required package: @angular-devkit/architect (via "@angular-devkit/architect") not declared Dec 11, 2019
@merceyz
Copy link
Member

merceyz commented Jan 2, 2021

PnP support for angular is tracked in yarnpkg/berry#266

@merceyz merceyz closed this as completed Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants