Closed h657070128 closed 7 years ago
Please check if the lib is present in your node_modules folder
Hi @zigzag95, it's there. The directory is like:
node_modules/
├── ...
├── quickstart-lib/
| └── bundles/
| | ├── quickstart-lib.umd.js
| | ├── quickstart-lib.umd.js
| | ├── quickstart-lib.umd.min.js
| | └── quickstart-lib.umd.min.js.map
| └── src/
| | ├── component/
| | | └── lib.component.d.ts
| | ├── service/
| | | └── lib.service.d.ts
| | └── module.d.ts
| └── index.d.ts
| └── quickstart-lib.d.ts
| └── quickstart-lib.es5.js
| └── quickstart-lib.es5.js.map
| └── quickstart-lib.metadata.json
| └── LICENSE
| └── package.json
| └── ...
├── ...
The doc from jvandemo/generate-angular2-library saved me.
Turns out that I forgot to set up the path mapping in /src/tsconfig.app.json
in my "Angular CLI-generated" consuming application (not library).
{
"compilerOptions": {
// ...
"paths": {
"@angular/*": [
"../node_modules/@angular/*"
]
}
}
}
I have path mapping in /src/tsconfig.app.json
but still getting this error, Also tried ng serve --preserve-symlinks
Hi, Thanks for building such a great quick-start library repo. It includes almost every aspects I can think of. I ran into a problem and struggled for a couple of days. Hope someone can help. I follow the guide and
npm run build
then I want consume it in my another project by
npm install --save my/local/path/to/angular-quickstart-lib/dist
then in app.module.ts, I do:
then I use
<my-lib></my-lib>
in app.component.htmlRun my project, in the browser console it shows:
I am using the same version of Angular (4.2.5) to avoid potential failure (but I do not think it is the root cause). Do you have any ideas? Actually I tried to build a library without using any seeds previously, following the steps of ngc, rollup, etc. and it ends up with this same problem.
Node version: 8.0.0 Npm version: 5.0.1 Typescript version: 2.3.4