https://pulumi.com logo
#general
Title
# general
b

bitter-dentist-28132

03/18/2020, 8:09 PM
is there a way to cache the pulumi plugins? it seems npm is wiping out the cache from my CI:
Copy code
npm ci
npm WARN prepare removing existing node_modules/ before installation
l

limited-rainbow-51650

03/18/2020, 8:17 PM
Which CI is this? I would rather find out why it behaves like this? Which version of npm are you using?
f

fast-dinner-32080

03/18/2020, 8:23 PM
So npm ci always removes all node_modules to make sure the modules only adheres to the package.json file.
l

limited-rainbow-51650

03/18/2020, 8:26 PM
@bitter-dentist-28132 is the package.json created on an OS different from the CI runner? If so, it looks like this: https://github.com/npm/cli/issues/558#issuecomment-569931551
b

bitter-dentist-28132

03/18/2020, 8:32 PM
you're talking about the
package-lock.json
not the
package.json
right?
l

limited-rainbow-51650

03/18/2020, 8:33 PM
Yep, my bad.
b

bitter-dentist-28132

03/18/2020, 8:35 PM
it looks like @fast-dinner-32080 is correct re: cleaning the `node_modules`:
If a 
node_modules
 is already present, it will be automatically removed before 
npm ci
 begins its install.
https://docs.npmjs.com/cli/ci.html
should i be using
npm install
in ci instead of
npm ci
then? that seems strange.
i'd ideally like some caching for CI
l

limited-rainbow-51650

03/18/2020, 8:40 PM
Hmm.. I thought that was what
npm ci
was all about: read the lock file, and update the
node_modules
only when there are differences.
because
npm install
(without arguments) does not adhere the lock file in all circumstances.
b

bitter-dentist-28132

03/19/2020, 1:50 PM
yeah... very weird that it blows away
node_modules
3 Views