Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
$ npm ci --global
npm ERR! code ECIGLOBAL
npm ERR! `npm ci` does not work for global packages
Expected Behavior
The documentation says that the global flag is allowed:
Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See folders for more on the differences in behavior.
- packages are installed into the
{prefix}/lib/node_modules folder, instead of the current working directory.
- bin files are linked to
{prefix}/bin
- man pages are linked to
{prefix}/share/man
Steps To Reproduce
- execute
npm ci -g.
Environment
The code raising the error is here:
|
if (this.npm.global) { |
|
throw Object.assign(new Error('`npm ci` does not work for global packages'), { |
|
code: 'ECIGLOBAL', |
|
}) |
|
} |
and there are tests for this:
|
t.test('should throw ECIGLOBAL', async t => { |
|
const { npm } = await loadMockNpm(t, { |
|
config: { global: true }, |
|
}) |
|
await t.rejects(npm.exec('ci', []), { code: 'ECIGLOBAL' }) |
|
}) |
so I guess my environment doesn't matter here.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Expected Behavior
The documentation says that the global flag is allowed:
Steps To Reproduce
npm ci -g.Environment
The code raising the error is here:
cli/lib/commands/ci.js
Lines 18 to 22 in 1c3612c
and there are tests for this:
cli/test/lib/commands/ci.js
Lines 184 to 189 in 1c3612c
so I guess my environment doesn't matter here.