-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Documentationdocumentation related issuedocumentation related issueNeeds Triageneeds review for next stepsneeds review for next stepsPriority 2secondary priority issuesecondary priority issueRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
$ npm ci --global
npm ERR! code ECIGLOBAL
npm ERR! `npm ci` does not work for global packagesExpected 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_modulesfolder, 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:
Lines 18 to 22 in 1c3612c
| 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:
Lines 184 to 189 in 1c3612c
| 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.
Metadata
Metadata
Assignees
Labels
Documentationdocumentation related issuedocumentation related issueNeeds Triageneeds review for next stepsneeds review for next stepsPriority 2secondary priority issuesecondary priority issueRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release