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 doesn't work with 1.5.4 version

See original GitHub issue

Versions

npm 5.5.1
node 8.9.0
angular 5.0.1
angular-cli 1.5.4
Windows 10

Repro steps

  • Generate project using ng new some-project
  • Create module and link @scope/mymodule
  • Compile module using ngc
  • Link module npm link
  • Link module to project cd some-project && npm link @scope/mymodule
  • Start project ng serve

Observed behavior

Error: StaticInjectorError[NgZone]: 
  StaticInjectorError[NgZone]: 
    NullInjectorError: No provider for NgZone!
    at _NullInjector.get (core.js:924)
    at resolveToken (core.js:1212)
    at tryResolveToken (core.js:1154)
    at StaticInjector.get (core.js:1025)
    at resolveToken (core.js:1212)
    at tryResolveToken (core.js:1154)
    at StaticInjector.get (core.js:1025)
    at resolveNgModuleDep (core.js:10586)
    at _createClass (core.js:10631)
    at _createProviderInstance$1 (core.js:10597)

Desired behavior

The module is linked to project, errors are missing.

Mention any other details that might be useful (optional)

If I delete my @angular folder from a linked module, the application runs as expected. I wrote console.log on each @angular/core file (project and library, @angular/core/esm5/core.js) and revealed that project(some-project) used first @angular/core module while library(@scope/mymodule) used it’s own @angular/core not root folder(node_modules) which is placed in the project directory.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jackjoycommented, Nov 29, 2017

Maybe my fault,try “–preserve-symlinks”.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why isn't the npm link command working? | Benjamin W Fox
This article is for anyone testing npm packages locally and who has struggled (or is struggling) to get to projects connected via npm...
Read more >
1.5.4 - @angular/cli - npm
CLI tool for Angular. Latest version: 15.0.4, last published: 9 days ago. Start using @angular/cli in your project by running `npm i ...
Read more >
What could cause an error related to npm not being able to ...
It might be related to corruption in Angular Packages or incompatibility of packages. Please follow the below steps to solve the issue. Delete ......
Read more >
Npm link set up advice and troubleshooting - Code Buckets
Troubleshooting npm link · 1. Check you've linked every package · 2. Don't globally install your local packages · 3. Check you've linked...
Read more >
Using npm link to use node modules that are "in progress"
It is some times convenient, even necessary, to make use of a module that you are working on before it has been published...
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