2
votes

I am having below error in Prod build. Can someone suggest how to fix this error?

Project 'ngx-build-plus' could not be found in workspace.

Error: Project 'ngx-build-plus' could not be found in workspace.

[email protected] ng /home/vsts/work/1/s at Workspace.getProject (/home/vsts/work/1/s/node_modules/@angular-devkit/core/src/workspace/workspace.js:93:19) at Architect.getBuilderConfiguration (/home/vsts/work/1/s/node_modules/@angular-devkit/architect/src/architect-legacy.js:117:41) at RunCommand.runSingleTarget (/home/vsts/work/1/s/node_modules/@angular/cli/models/architect-command.js:160:45) ng "run" "ngx-build-plus:build" angular.json

"architect": {
        "build": {
          "builder": "ngx-build-plus:build",
           .. ..
}
2

2 Answers

0
votes

You need to run a build of your library so that it has a home in your dist folder before you build your app.

ng serve and ng build commands will need it there. Once you've done that you will also be able to import your library into your project where needed.

Keep in mind this assumes that you have your public-api.ts and $library-name.module.ts lined up right based on your needs so your library and/or it's assets can be exported from your library correctly.

0
votes

In my case, I removed package-lock.json

after that I made

npm i

and

ng build