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

Installing Angular-CLI happens on every run #314

Closed
lverns opened this issue Sep 11, 2017 · 7 comments
Closed

Installing Angular-CLI happens on every run #314

lverns opened this issue Sep 11, 2017 · 7 comments
Labels
needs-feedback Further information is requested needs-help Extra attention is needed

Comments

@lverns
Copy link

lverns commented Sep 11, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: I'm running 4.8.1 on the server and 4.10.7 on the client
  • Ruby: 2.0.0p648 (server), 2.3.4p301 (client)
  • Distribution: CentOS, 7.3.1611 (server), Fedora 25 (client)
  • Module version: 3.0.0

How to reproduce (e.g Puppet code you use)

On the server, I have the following class:

class npm_packages {
  
  class { 'nodejs': 
    manage_package_repo => false,
    nodejs_dev_package_ensure => 'present',
    npm_package_ensure => 'present',
  }
 
  package { 'typescript':
    ensure => 'present',
    provider => 'npm'
  }

  package { '@angular/cli@1.0.0':
    ensure => 'present',
    provider => 'npm'
  }
}

What are you seeing

ng seems to be properly installed, but every time I run the client, I see the following entry in the log:

Notice: /Stage[main]/Npm_packages/Package[@angular/cli@1.0.0]/ensure: created

What behaviour did you expect instead

I would expect to only see this entry the first time the client runs.

@ekohl
Copy link
Member

ekohl commented Sep 12, 2017

I'm not that familiar with npm but I suspect this is something in puppet itself since you use the package resource. Could it be that it should be angular/cli@1.0.0 and the leading @ is tripping it up?

@lverns
Copy link
Author

lverns commented Sep 12, 2017

I took the @ off and while puppet still claims to run correctly, ng is not made accessible on the PATH. (Note that the first @ is part of the package name.)

I now see this on every run:

Notice: /Stage[main]/Npm_packages/Package[typescript]/ensure: created
Notice: /Stage[main]/Npm_packages/Package[angular/cli@1.0.0]/ensure: created

Re-adding the @ changes the output to

Notice: /Stage[main]/Npm_packages/Package[typescript]/ensure: created
Notice: /Stage[main]/Npm_packages/Package[@angular/cli@1.0.0]/ensure: created

but still doesn't properly install Angular CLI.

So the package is only properly installed on clients that were first run with the @ present, and I looks like I'll have to do some manual manipulation to get the other test boxes back into a good state.

@matheo
Copy link

matheo commented Sep 15, 2017

I enabled the debug and it effectively runs

==> default: Notice: /Stage[main]/Main/Package[webpack-dev-server]/ensure: created
==> default: Debug: /Package[webpack-dev-server]: The container Class[Main] will propagate my refresh event
==> default: Debug: Executing: '/usr/bin/npm list --json --global'
==> default: Debug: Executing: '/usr/bin/npm install --global @angular/cli'

but it hangs, no idea if it's because the dependencies are many, but it doesn't make sense because from a Vagrant instance without it, I was able to run it and it doesn't take that much.

@ekohl
Copy link
Member

ekohl commented Sep 15, 2017

I wonder what /usr/bin/npm list --json --global shows. Does it include @angular/cli?

@matheo
Copy link

matheo commented Sep 15, 2017

I've moved @angular/cli installation to a command execution and after 5 mins I get a timeout, not just infinitely stuck:

==> default: Debug: Exec[Install Angular CLI](provider=posix): Executing '/usr/bin/npm install --global @angular/cli'
==> default: Debug: Executing: '/usr/bin/npm install --global @angular/cli'
==> default: Error: Command exceeded timeout
==> default: Error: /Stage[main]/Main/Exec[Install Angular CLI]/returns: change from notrun to 0 failed: Command exceeded timeout

Then executing:

/usr/bin/npm list --global --depth=0

it's indeed installed, so it's a problem with the return status?

/usr/lib
├── @angular/cli@1.4.2

@ekohl
Copy link
Member

ekohl commented Sep 15, 2017

My expertise is puppet, not nodejs. This feels like an issue with nodejs/npm itself so I'm afraid I can't be of any help.

@juniorsysadmin juniorsysadmin added needs-feedback Further information is requested needs-help Extra attention is needed labels Sep 24, 2017
@juniorsysadmin
Copy link
Member

juniorsysadmin commented Apr 29, 2018

There has been no recent correspondence on this, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested needs-help Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants