Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beta.31] npm WARN at installation in global #4575

Closed
lacolaco opened this issue Feb 10, 2017 · 12 comments · Fixed by #4592
Closed

[beta.31] npm WARN at installation in global #4575

lacolaco opened this issue Feb 10, 2017 · 12 comments · Fixed by #4592

Comments

@lacolaco
Copy link
Contributor

Please provide us with the following information:

When I run npm -g i @angular/cli, warnings are shown as the below:

npm WARN @ngtools/[email protected] requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed.
npm WARN @ngtools/[email protected] requires a peer of @angular/compiler-cli@^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed.
npm WARN @ngtools/[email protected] requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed.
npm WARN @ngtools/[email protected] requires a peer of @angular/tsc-wrapped@^0.5.0 but none was installed.

OS?

Mac OS El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

@angular/cli: 1.0.0-beta.31
node: 6.9.5
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

$ npm -g uni @angular/cli
$ npm -g i @angular/cli

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

@lacolaco lacolaco changed the title npm WARN at installation in global [beta.31] npm WARN at installation in global Feb 10, 2017
@alaindeurveilher
Copy link

Again, as a workaround, installing all these modules globally after the update of @angular/cli makes everything work correctly for me:

npm install -g @angular/cli@latest
npm install -g @angular/compiler@^2.3.1 @angular/compiler-cli@^2.3.1 @angular/core@^2.3.1 @angular/tsc-wrapped@^0.5.0 @ngtools/webpack
npm install -g typescript@^2.0.2 zone.js@^0.7.2

filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 10, 2017
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert angular#4473
Fix angular#4575
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 10, 2017
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert angular#4473
Fix angular#4575
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 10, 2017
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert angular#4473
Fix angular#4575
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 13, 2017
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert angular#4473
Fix angular#4575
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 13, 2017
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert angular#4473
Fix angular#4575
@rahul-winner
Copy link

workaround suggested by @AlainD- indeed works.. However, that may not be acceptable in long run..

I could see that @filipesilva had committed a fix yesterday. However, could anyone please let me know in which release it will be made available?

@nam4dev
Copy link

nam4dev commented Feb 14, 2017

OS: Linux (Ubuntu 14.04 LTS)

The application was initially created with angular-cli 1.0.0-beta.26

Versions

@angular/cli: 1.0.0-beta.31
node: 6.2.2
os: linux x64
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/compiler-cli: 2.4.7
@angular/cli: 1.0.0-beta.31
@ngtools/webpack: 1.2.9

Steps to reproduce

First, I removed previous angular-cli and cleared the cache,

sudo npm uninstall -g angular-cli
sudo npm cache clear

Then, I applied @AlainD- workaround,

sudo npm install -g @angular/cli@latest
sudo npm install -g @angular/compiler@^2.3.1 @angular/compiler-cli@^2.3.1 @angular/core@^2.3.1 @angular/tsc-wrapped@^0.5.0 @ngtools/webpack
sudo npm install -g typescript@^2.0.2 zone.js@^0.7.2

No visible failure (traces)

It is tricky but compiler detects changes & my browser gets updated as if all was working perfectly!

But, when I tried to change some code, it does not reflect it!

Take the following scenario,

Before applying @AlainD- workaround, my callback was printing titi on a click event.

  1. I change my callback to,

    callback(event: Event) { console.log('toto'); }

  2. Change is detected & Browser is refreshed.

  3. When I click, it still prints titi.

    • Clear explicitly browser cache or through CTRL + F5 has no effect.
  4. When I stop ng serve, then start it again, it finally prints toto !!

What am I missing ?

Any help appreciated :)

@alaindeurveilher
Copy link

My guess is that since you did not stop ng serve during the update, your ng command was the one from [email protected], serving the code compiled with the old angular compiler.

I supposed that after having stopped ng serve, the removal of the remaining artefacts/cache/memory of the old angular-cli has been flushed. And when starting the command ng serve again, it is actually the ng command of the newly installed @angular/cli which is launched, along with the new version of the compiler. That's why you have your changes reflected now.

But it is not clear if you (still) have an issue after restarting ng serve. Probably you could clarify that last point.

@nam4dev
Copy link

nam4dev commented Feb 14, 2017

Sorry, I was not clear enough :)

Initially, I bumped into this issue,

[WDS] App updated. Recompiling...
[WDS] Nothing changed.

described here & there.

I finally got to upgrade and apply your solution (@AlainD-), hoping it fixes my initial issue!

That's why you have your changes reflected now.

No I do NOT have any changes reflected

  • That's actually my issue, the compiler detects changes & my browser get refreshed but the code which is running is not refreshed at all!

As described in my previous message, when i change my code, it is well detected (thanks to your workaround) and my browser gets refreshed, but the code running does not reflect the changes!

Hoping being more clear,

Thanks for your help :)

@simonefternamn
Copy link

@alaind : Because of limited cli experience (and possibly low intelligence 😀 ) I am not sure how to interpret your workaround.

It consists of three lines, all beginning with "npm install -g", of which I had already run the first one, which is what gave me the warnings of unmet dependencies that led me here eventually.

Therefore, I concluded I should begin with the second line of your workaround, and I did, and it complained about the following unmet peer dependencies:

  • rxjs@^5.0.0-rc.4
  • typescript@^2.0.2
  • webpack@^2.2.0
  • zone.js@^0.7.2

Next, following my interpretation of your workaround, I ran the third line, which addressed two of the unmet dependencies from above and which led to no complaints at all.

Now I am wondering if this is really it, and I would guess it isn't since, for example, I have done nothing (that I know of) about some of the aforementioned unmet peer dependencies.

Plz help! I have an exam tomorrow and cannot aquire ng-skills without this.

/Simon

Oh, and my OS is Windows 10 Education x64 and I am running commands from an elevated PowerShell.

@alaindeurveilher
Copy link

@nam4dev I'm not a developper of angular/cli nor a contributor to this repo. Just a guy trying to learn, as much as you, this new stuffs. I just figured that providing valuable details would help the contributors of angular cli to help you on your issue.

@simonefternamn That's exactly how i processed my problems when I got them. I just read the warning messages, and decided to install the missing dependencies manually afterward to try to fix them, and that worked for me.

@simonefternamn
Copy link

It seems like I had to install all those packages with one single npm install -g-command in order to not get any warnings.

I don't know how to check what is installed, however, and what I needed the installation for still doesn't work, unfortunately.

Thanks anyway, @AlainD-

@nam4dev
Copy link

nam4dev commented Feb 15, 2017

@AlainD- Of course, I understand well your point and I thank you for your time and help! Anyway, I finally got it to work properly ;)

Using Jet brains IDE, I already fixed inotify with suggested value 524288 as described here.
But in my case, it was likely not enough!
After increasing limit to 10 times more, it worked again as expected :)

For those who may encounter the same issue as me, below what fixed it:

sudo sysctl fs.inotify.max_user_watches=524288 (786432 instead)
sudo sysctl -p --system

Restart your IDE

@alaindeurveilher
Copy link

@nam4dev I read here #2389 (comment) that modifying those settings are not advised, and could cause memory issues instead.

@alaindeurveilher
Copy link

@simonefternamn normally you should have at the end the npm install a summary of all the detected warnings and errors found during the installation. So if you did not get anything, it's fine.

For info, you could run a npm list -g to list all the packages installed globally. or npm list -g a-package-name to check the installation (globally) of the specific package a-package-name.

Same goes for packages in a local project by removing the -g option in the command line.

filipesilva added a commit that referenced this issue Feb 15, 2017
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert #4473
Fix #4575
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert angular#4473
Fix angular#4575
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants