99// this _can_ be done from bash or shell,
1010// but now the portability problems loom large.
1111
12- const { spawn, execSync } = require ( 'child_process' )
12+ const { spawn } = require ( 'child_process' )
1313const pipeStdIo = { stdio : [ process . stdin , process . stdout , process . stderr ] }
1414
15- // Always clear storage so the latest versions are published
16- // I am not worried about _what_ version number is published
17- // Only that it is the latest code
18- execSync ( 'rm -rf verdaccio/.npx' )
19-
2015// I am assuming that you used `local_verdaccio_publish`
2116// But either way,
2217// this is to facilitate running `npx`
@@ -29,13 +24,17 @@ const verdaccio = spawn('npx', ['verdaccio', '-c', 'verdaccio/config.yaml'], pip
2924
3025const args = [
3126 '--userconfig' , 'verdaccio/npmrc' ,
32- '--ignore-existing' ,
33- '--cache' , 'verdaccio/.npx' ,
34- // This is **very** important,
27+ // In npx v6 ignore-existing let you install the latest version
28+ // regardless of what was installed locally.
29+ // In npx v7 this is disable and if you need to install anything
30+ // then --yes is *required*
31+ '--ignore-existing' , '--yes' ,
32+ // This is **very** important, (npx ~v6)
3533 // without this, npx may mask error codes.
3634 // In testing it was possible to have errors in the npx command
3735 // but the spawned process here did not exit with a non-zero exit code.
3836 // See `execCommand` in `libnpx` for specifics
37+ // In npx v7 this option is deprecated
3938 '--always-spawn' ,
4039 // Yes, this is dangerous.
4140 // But I'm trying to replicate _just running npx_
@@ -44,6 +43,8 @@ const args = [
4443]
4544
4645spawn ( 'npx' , args , {
46+ // npx v7 will *not* install from any repository if any version exists locally.
47+ cwd : 'verdaccio/integration' ,
4748 // This instance of npx needs to target the verdaccio server
4849 // so the env var that governs this needs to be updated.
4950 // it is _possible_ for this value to already be set.
0 commit comments