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

Is this supposed to cache installed modules? #82

Open
airtonix opened this issue Dec 13, 2016 · 2 comments
Open

Is this supposed to cache installed modules? #82

airtonix opened this issue Dec 13, 2016 · 2 comments

Comments

@airtonix
Copy link

airtonix commented Dec 13, 2016

I assumed uNpm would be a replacement for Sinopia.

However in my /unpm/datadirectory, is void of modules:

[rancher@rancher unpm]$ ls -al ./**
./meta:
total 8
drwxrwxrwx    2 root     root          4096 Nov 24 23:50 .
drwxrwxrwx    8 root     root          4096 Dec 13 23:24 ..

./static:
total 24
drwxrwxrwx    6 root     root          4096 Nov 25 00:48 .
drwxrwxrwx    8 root     root          4096 Dec 13 23:24 ..
drwxrwxr-x    2 999      users         4096 Nov 25 00:44 css
drwxrwxr-x    2 999      users         4096 Nov 25 00:44 errors
drwxrwxr-x    2 999      users         4096 Nov 25 00:44 images
drwxrwxr-x    2 999      users         4096 Nov 25 00:48 js

./store:
total 8
drwxrwxrwx    2 root     root          4096 Nov 24 23:50 .
drwxrwxrwx    8 root     root          4096 Dec 13 23:24 ..

./tarballs:
total 8
drwxrwxrwx    2 root     root          4096 Nov 24 23:50 .
drwxrwxrwx    8 root     root          4096 Dec 13 23:24 ..

./templates:
total 32
drwxrwxr-x    2 999      users         4096 Nov 25 00:43 .
drwxrwxrwx    8 root     root          4096 Dec 13 23:24 ..
-rwxrw-r--    1 999      users          521 Mar  4  2015 dependents.html
-rwxrw-r--    1 999      users           97 Mar  4  2015 footer.html
-rwxrw-r--    1 999      users           99 Mar  4  2015 head.html
-rwxrw-r--    1 999      users           49 Mar  4  2015 header.html
-rwxrw-r--    1 999      users          361 Mar  4  2015 index.html
-rwxrw-r--    1 999      users         2693 Mar  4  2015 package.html

./users:
total 8
drwxrwxrwx    2 root     root          4096 Nov 24 23:50 .
drwxrwxrwx    8 root     root          4096 Dec 13 23:24 ..
[rancher@rancher unpm]$

Few things:

  • using unpm-www
  • using docker
  • unpm image is morlay/unpm, Dockerfile
  • unpm-www is airtonix/unpm-www Dockerfile
@hayes
Copy link
Owner

hayes commented Dec 13, 2016

It does not currently support caching. It was initially left out on purpose, but could be added with a plugin, or I would accept a PR that enabled it behind a config option.

The use case I originally wrote this for involved having much more explicit control over what packages could be installed in production. Enabling read-through to public npm and caching those installs is very counter to that idea, which is why it is not currently a built in feature. Instead we used (clone-packages)[https://www.npmjs.com/package/clone-packages] to load the modules we wanted to explicitly whitelist into the registry.

@hayes
Copy link
Owner

hayes commented Dec 14, 2016

One reason this is a little tricky is that the registry does not currently ready the tarball for packages not in the registry. npm install happens in 2 steps, the first gets meta data about what package versions are available, the second is to determine what version to install, and to download the tarball. The url for the tarball is returned in the meta request, and unpm currently just returns the url of the tarball in the upstream registry when using the fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants