question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm link src with angular 5

See original GitHub issue

I have symlinks enabled:

"build": {
      "preserveSymlinks": true
    }

but when I try to run against npm link with src, I get this error:

ERROR in ./node_modules/mylibrary/index.ts Module build failed: Error: /Users/sgentile/Workspaces/myproject/node_modules/mylibrary/index.ts is not part of the compilation output. Please check theother error messages for details.

Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
sgentilecommented, Dec 30, 2017

For development so you don’t have to recompile after every change. What you described is very time consuming and not very productive

Certainly before preparing for release we link to dist.

On Dec 30, 2017 3:41 AM, “Ante Adamovic” notifications@github.com wrote:

Why are you trying to link the src anyway, you’re suppose to link the dist directory. Angular 5 has known issues with compilation so it often doesn’t accept raw TS files from third party libraries. I’ve ran into this problem with my own library which is why I’m checking this one out and it works great, simply run npm run build and then switch to dist directory and run npm link there.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvandemo/generator-angular2-library/issues/252#issuecomment-354534636, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIFND97U1Aabeep5RpJNmiq20AJLxASks5tFfcugaJpZM4REtK5 .

1reaction
anteAdamoviccommented, Dec 30, 2017

Why are you trying to link the src anyway, you’re suppose to link the dist directory. Angular 5 has known issues with compilation so it often doesn’t accept raw TS files from third party libraries. I’ve ran into this problem with my own library which is why I’m checking this one out and it works great, simply run npm run build and then switch to dist directory and run npm link there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Pro Tip] `npm link` explained - DEV Community ‍ ‍
npm link creates a symbolic link (symlink) from your <global node_modules> directory to the local library's directory. · The catch is that you ......
Read more >
Linking local library into Angular 5 Project - Stack Overflow
open two terminal windows · in the first terminal, go to your Angular library's root folder and run ng build --watch · check...
Read more >
Readme - @angular/cli - npm
Generating and serving an Angular project via a development server ... Navigate to http://localhost:4200/ . The app will automatically reload if ...
Read more >
Angular 5: NPM Link - model/index.ts is not part of the ... - GitHub
The error I'm getting is: node_modules/other-repo/src/lib/index.ts is not part of the compilation output. Please check the other error messages ...
Read more >
Test and debug Angular library using npm link - Dmitri Galejev
What happens is we have placed the library project files into a global node_modules location. You can run this command to find out...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found