I'm currently tackling a project that is divided into multiple angular projects. Within these projects, there are some services that are shared. Is there a way for me to incorporate these services into my project without encountering errors?
/root
/project-1
/angular.json
/tsconfig.json
/project-2
/angular.json
/tsconfig.json
/utilities
/src
/auth.service.ts
/s3.service.ts
/lambda.service.ts
Within the root folder of the angular projects tsconfig.json
, I have the following configuration (project-1, project-2):
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@utilities/*": [
"../utilities/src/*"
]
}
}
}
Whenever I initiate npm start
in project-1
, I encounter the following error(s):
Error: ../utilities/node_modules/buffer-equal-constant-time/index.js
Module not found: Error: Can't resolve 'buffer' in 'C:\projects\utilities\node_modules\buffer-equal-constant-time'
// The same error message repeats for different modules...
Here's the content of my utilities/package.json
:
{
"dependencies": {
"@angular/core": "^11.0.5",
"@aws-sdk/client-cognito-identity": "^3.0.0",
"@aws-sdk/client-lambda": "^3.0.0",
"@aws-sdk/credential-provider-cognito-identity": "^3.0.0",
"jsonwebtoken": "^8.5.1",
"rxjs": "^6.6.3",
"tslib": "^2.0.0"
},
}