1

I have an npm private repo through sinopia I have published an app in this. It is a full end-to-end application using Angular2 on the UI side. It has its own dependencies mentioned in package.json such as @angular/core, animations etc.

When I install this pvt module, I am getting an error where it is unable to install sub-dependencies, i.e. dependencies which are part of pvt module.

Screenshot of the error:

enter image description here

Sabuncu
  • 5,095
  • 5
  • 55
  • 89
arjun
  • 11
  • 5

2 Answers2

1

It's looking for dependencies which are not global but that are in your private repository. You should change the configuration to allow download of these dependencies from the global npm repository. Add this configuration to .npmrc file

 @angular:registry=registry.npmjs.org 
alexKhymenko
  • 5,450
  • 23
  • 40
  • Thank you, Can you please show me how can I make changes so that it can install packages from global npm repo when I install this pvt package. – arjun Sep 20 '17 at 22:28
  • you mean to add the above line into my Pvt module and then publish it? I tried that but didn't work. My main problem is I am unable to install public dependencies of my Pvt module. – arjun Sep 21 '17 at 17:46
  • yes this worked partially, I mean now the @angular modules are getting downloaded outside the project. So, when I install my Pvt package all the sub-dependencies which should come inside the module are getting installed separately. So the application is unable to access it as the path is changing(going one level up) – arjun Sep 21 '17 at 22:20
0

The following is just workaround to skip sinopia which is not optimal.

@angular:registry=registry.npmjs.org 

Sinopia does not support scope packages by default unless you update to the configuration file with

packages:
  '@*/*':
    # scoped packages
    access: $all
    allow_access: $all
    allow_publish: $authenticated
    publish: $authenticated

Anyway. I'll recommend instead use sinopia moves to sinopia's fork verdaccio which scope packages support is built-in.

http://www.verdaccio.org/docs/en/packages.html

Juan Picado
  • 1,823
  • 18
  • 33