npm / npm

This repository is moving to: https://github.com/npm/cli
http://npm.community
17.53k stars 3.02k forks source link

I have to run 'npm prune --production' 3 times to remove all my devDependencies #16664

Closed attila123 closed 7 years ago

attila123 commented 7 years ago

I'm opening this issue because:

What's going wrong?

I need to run 'npm prune --production' 3 times to remove all my devDependencies

How can the CLI team reproduce the problem?

Please use this package.json:

{
  "name": "npm-prune-test",
  "version": "1.0.0",
  "description": "npm-prune-test",
  "dependencies": {
  },
  "devDependencies": {
    "@types/express": "4.0.35",
    "@types/express-session": "0.0.32",
    "@types/lodash": "4.14.52",
    "@types/node": "7.0.4",
    "@types/node-uuid": "0.0.x",
    "async": "2.1.2",
    "chai": "3.5.0",
    "cookie": "0.3.1",
    "event-source-polyfill": "0.0.7",
    "eventsource": "0.2.1",
    "istanbul": "0.4.5",
    "jenkins-mocha": "3.0.4",
    "jsdoc": "3.4.2",
    "mocha": "3.1.2",
    "mock-require": "1.3.0",
    "node-mocks-http": "1.5.4",
    "proxyquire": "1.7.10",
    "sinon": "1.17.6",
    "typescript": "2.1.5"
  }
}

Please see the commands and their output:

avangel@hp-g1:/tmp/0_npm_prune_test$ ls -l
total 4
-rw-r--r-- 1 avangel avangel 675 May 19 17:50 package.json
avangel@hp-g1:/tmp/0_npm_prune_test$ npm install
npm WARN prefer global marked@0.3.6 should be installed with -g
npm-prune-test@1.0.0 /tmp/0_npm_prune_test
├─┬ @types/express@4.0.35 
│ ├─┬ @types/express-serve-static-core@4.0.44 
│ │ └── @types/node@7.0.4  deduped
│ └─┬ @types/serve-static@1.7.31 
│   ├── @types/express-serve-static-core@4.0.44  deduped
│   └── @types/mime@0.0.29 
├─┬ @types/express-session@0.0.32 
│ ├── @types/express@4.0.35  deduped
│ └── @types/node@7.0.4  deduped
├── @types/lodash@4.14.52 
├── @types/node@7.0.4 
├─┬ @types/node-uuid@0.0.28 
│ └── @types/node@7.0.4  deduped
├─┬ async@2.1.2 
│ └── lodash@4.17.4 
├─┬ chai@3.5.0 
│ ├── assertion-error@1.0.2 
│ ├─┬ deep-eql@0.1.3 
│ │ └── type-detect@0.1.1 
│ └── type-detect@1.0.0 
├── cookie@0.3.1 
├── event-source-polyfill@0.0.7 
├─┬ eventsource@0.2.1 
│ └─┬ original@1.0.0 
│   └─┬ url-parse@1.0.5 
│     ├── querystringify@0.0.4 
│     └── requires-port@1.0.0 
├─┬ istanbul@0.4.5 
│ ├── abbrev@1.0.9 
│ ├── async@1.5.2 
│ ├─┬ escodegen@1.8.1 
│ │ ├── esprima@2.7.3  deduped
│ │ ├── estraverse@1.9.3 
│ │ ├── esutils@2.0.2 
│ │ ├─┬ optionator@0.8.2 
│ │ │ ├── deep-is@0.1.3 
│ │ │ ├── fast-levenshtein@2.0.6 
│ │ │ ├─┬ levn@0.3.0 
│ │ │ │ ├── prelude-ls@1.1.2  deduped
│ │ │ │ └── type-check@0.3.2  deduped
│ │ │ ├── prelude-ls@1.1.2 
│ │ │ ├─┬ type-check@0.3.2 
│ │ │ │ └── prelude-ls@1.1.2  deduped
│ │ │ └── wordwrap@1.0.0  deduped
│ │ └─┬ source-map@0.2.0 
│ │   └── amdefine@1.0.1 
│ ├── esprima@2.7.3 
│ ├─┬ glob@5.0.15 
│ │ ├─┬ inflight@1.0.6 
│ │ │ ├── once@1.4.0  deduped
│ │ │ └── wrappy@1.0.2  deduped
│ │ ├── inherits@2.0.3 
│ │ ├─┬ minimatch@3.0.4 
│ │ │ └─┬ brace-expansion@1.1.7 
│ │ │   ├── balanced-match@0.4.2 
│ │ │   └── concat-map@0.0.1 
│ │ ├── once@1.4.0  deduped
│ │ └── path-is-absolute@1.0.1 
│ ├─┬ handlebars@4.0.8 
│ │ ├── async@1.5.2 
│ │ ├─┬ optimist@0.6.1 
│ │ │ ├── minimist@0.0.10 
│ │ │ └── wordwrap@0.0.3 
│ │ ├─┬ source-map@0.4.4 
│ │ │ └── amdefine@1.0.1  deduped
│ │ └─┬ uglify-js@2.8.27 
│ │   ├── source-map@0.5.6 
│ │   ├── uglify-to-browserify@1.0.2 
│ │   └─┬ yargs@3.10.0 
│ │     ├── camelcase@1.2.1 
│ │     ├─┬ cliui@2.1.0 
│ │     │ ├─┬ center-align@0.1.3 
│ │     │ │ ├─┬ align-text@0.1.4 
│ │     │ │ │ ├─┬ kind-of@3.2.2 
│ │     │ │ │ │ └── is-buffer@1.1.5 
│ │     │ │ │ ├── longest@1.0.1 
│ │     │ │ │ └── repeat-string@1.6.1 
│ │     │ │ └── lazy-cache@1.0.4 
│ │     │ ├─┬ right-align@0.1.3 
│ │     │ │ └── align-text@0.1.4  deduped
│ │     │ └── wordwrap@0.0.2 
│ │     ├── decamelize@1.2.0 
│ │     └── window-size@0.1.0 
│ ├─┬ js-yaml@3.8.4 
│ │ ├─┬ argparse@1.0.9 
│ │ │ └── sprintf-js@1.0.3 
│ │ └── esprima@3.1.3 
│ ├─┬ mkdirp@0.5.1 
│ │ └── minimist@0.0.8 
│ ├─┬ nopt@3.0.6 
│ │ └── abbrev@1.0.9  deduped
│ ├─┬ once@1.4.0 
│ │ └── wrappy@1.0.2 
│ ├── resolve@1.1.7 
│ ├─┬ supports-color@3.2.3 
│ │ └── has-flag@1.0.0 
│ ├─┬ which@1.2.14 
│ │ └── isexe@2.0.0 
│ └── wordwrap@1.0.0 
├─┬ jenkins-mocha@3.0.4 
│ ├── istanbul@0.4.5  deduped
│ ├── mocha@3.1.2  deduped
│ ├─┬ npm-which@3.0.1 
│ │ ├── commander@2.9.0  deduped
│ │ ├─┬ npm-path@2.0.3 
│ │ │ └── which@1.2.14  deduped
│ │ └── which@1.2.14  deduped
│ ├── shell-escape@0.2.0 
│ ├─┬ shelljs@0.7.7 
│ │ ├─┬ glob@7.1.1 
│ │ │ ├── fs.realpath@1.0.0  deduped
│ │ │ ├── inflight@1.0.6  deduped
│ │ │ ├── inherits@2.0.3  deduped
│ │ │ ├── minimatch@3.0.4  deduped
│ │ │ ├── once@1.4.0  deduped
│ │ │ └── path-is-absolute@1.0.1  deduped
│ │ ├── interpret@1.0.3 
│ │ └─┬ rechoir@0.6.2 
│ │   └── resolve@1.1.7  deduped
│ └── spec-xunit-file@0.0.1-3 
├─┬ jsdoc@3.4.2 
│ ├── bluebird@3.4.7 
│ ├─┬ catharsis@0.8.8 
│ │ └─┬ underscore-contrib@0.3.0 
│ │   └── underscore@1.6.0 
│ ├── escape-string-regexp@1.0.5 
│ ├─┬ espree@3.1.7 
│ │ ├── acorn@3.3.0 
│ │ └─┬ acorn-jsx@3.0.1 
│ │   └── acorn@3.3.0  deduped
│ ├── js2xmlparser@1.0.0 
│ ├─┬ klaw@1.3.1 
│ │ └── graceful-fs@4.1.11 
│ ├── marked@0.3.6 
│ ├── mkdirp@0.5.1  deduped
│ ├─┬ requizzle@0.2.1 
│ │ └── underscore@1.6.0 
│ ├── strip-json-comments@2.0.1 
│ ├── taffydb@2.6.2 
│ └── underscore@1.8.3 
├─┬ mocha@3.1.2 
│ ├── browser-stdout@1.3.0 
│ ├─┬ commander@2.9.0 
│ │ └── graceful-readlink@1.0.1 
│ ├─┬ debug@2.2.0 
│ │ └── ms@0.7.1 
│ ├── diff@1.4.0 
│ ├── escape-string-regexp@1.0.5  deduped
│ ├─┬ glob@7.0.5 
│ │ ├── fs.realpath@1.0.0 
│ │ ├── inflight@1.0.6  deduped
│ │ ├── inherits@2.0.3  deduped
│ │ ├── minimatch@3.0.4  deduped
│ │ ├── once@1.4.0  deduped
│ │ └── path-is-absolute@1.0.1  deduped
│ ├── growl@1.9.2 
│ ├── json3@3.3.2 
│ ├─┬ lodash.create@3.1.1 
│ │ ├─┬ lodash._baseassign@3.2.0 
│ │ │ ├── lodash._basecopy@3.0.1 
│ │ │ └─┬ lodash.keys@3.1.2 
│ │ │   ├── lodash._getnative@3.9.1 
│ │ │   ├── lodash.isarguments@3.1.0 
│ │ │   └── lodash.isarray@3.0.4 
│ │ ├── lodash._basecreate@3.0.3 
│ │ └── lodash._isiterateecall@3.0.9 
│ ├── mkdirp@0.5.1  deduped
│ └─┬ supports-color@3.1.2 
│   └── has-flag@1.0.0  deduped
├─┬ mock-require@1.3.0 
│ └─┬ caller-id@0.1.0 
│   └── stack-trace@0.0.10 
├─┬ node-mocks-http@1.5.4 
│ ├─┬ accepts@1.3.3 
│ │ ├─┬ mime-types@2.1.15 
│ │ │ └── mime-db@1.27.0 
│ │ └── negotiator@0.6.1 
│ ├── lodash.assign@4.2.0 
│ ├── mime@1.3.6 
│ └─┬ type-is@1.6.15 
│   ├── media-typer@0.3.0 
│   └── mime-types@2.1.15  deduped
├─┬ proxyquire@1.7.10 
│ ├─┬ fill-keys@1.0.2 
│ │ ├── is-object@1.0.1 
│ │ └── merge-descriptors@1.0.1 
│ ├── module-not-found-error@1.0.1 
│ └── resolve@1.1.7  deduped
├─┬ sinon@1.17.6 
│ ├─┬ formatio@1.1.1 
│ │ └── samsam@1.1.2  deduped
│ ├── lolex@1.3.2 
│ ├── samsam@1.1.2 
│ └─┬ util@0.10.3 
│   └── inherits@2.0.1 
└── typescript@2.1.5 

npm WARN npm-prune-test@1.0.0 No repository field.
npm WARN npm-prune-test@1.0.0 No license field.
avangel@hp-g1:/tmp/0_npm_prune_test$ npm prune --production
- acorn@3.3.0 node_modules/acorn
- acorn-jsx@3.0.1 node_modules/acorn-jsx
- assertion-error@1.0.2 node_modules/assertion-error
- bluebird@3.4.7 node_modules/bluebird
- type-detect@0.1.1 node_modules/deep-eql/node_modules/type-detect
- deep-eql@0.1.3 node_modules/deep-eql
- espree@3.1.7 node_modules/espree
- graceful-fs@4.1.11 node_modules/graceful-fs
- interpret@1.0.3 node_modules/interpret
- is-object@1.0.1 node_modules/is-object
- js2xmlparser@1.0.0 node_modules/js2xmlparser
- klaw@1.3.1 node_modules/klaw
- lodash@4.17.4 node_modules/lodash
- lodash.assign@4.2.0 node_modules/lodash.assign
- lolex@1.3.2 node_modules/lolex
- marked@0.3.6 node_modules/marked
- media-typer@0.3.0 node_modules/media-typer
- merge-descriptors@1.0.1 node_modules/merge-descriptors
- fill-keys@1.0.2 node_modules/fill-keys
- mime@1.3.6 node_modules/mime
- mime-db@1.27.0 node_modules/mime-db
- mime-types@2.1.15 node_modules/mime-types
- module-not-found-error@1.0.1 node_modules/module-not-found-error
- negotiator@0.6.1 node_modules/negotiator
- accepts@1.3.3 node_modules/accepts
- npm-path@2.0.3 node_modules/npm-path
- npm-which@3.0.1 node_modules/npm-which
- querystringify@0.0.4 node_modules/querystringify
- rechoir@0.6.2 node_modules/rechoir
- requires-port@1.0.0 node_modules/requires-port
- underscore@1.6.0 node_modules/requizzle/node_modules/underscore
- requizzle@0.2.1 node_modules/requizzle
- samsam@1.1.2 node_modules/samsam
- formatio@1.1.1 node_modules/formatio
- shell-escape@0.2.0 node_modules/shell-escape
- glob@7.1.1 node_modules/shelljs/node_modules/glob
- shelljs@0.7.7 node_modules/shelljs
- spec-xunit-file@0.0.1-3 node_modules/spec-xunit-file
- stack-trace@0.0.10 node_modules/stack-trace
- caller-id@0.1.0 node_modules/caller-id
- strip-json-comments@2.0.1 node_modules/strip-json-comments
- taffydb@2.6.2 node_modules/taffydb
- type-detect@1.0.0 node_modules/type-detect
- type-is@1.6.15 node_modules/type-is
- underscore@1.8.3 node_modules/underscore
- underscore@1.6.0 node_modules/underscore-contrib/node_modules/underscore
- underscore-contrib@0.3.0 node_modules/underscore-contrib
- catharsis@0.8.8 node_modules/catharsis
- url-parse@1.0.5 node_modules/url-parse
- original@1.0.0 node_modules/original
- inherits@2.0.1 node_modules/util/node_modules/inherits
- util@0.10.3 node_modules/util
- @types/express-session@0.0.32 node_modules/@types/express-session
- @types/lodash@4.14.52 node_modules/@types/lodash
- @types/node-uuid@0.0.28 node_modules/@types/node-uuid
- async@2.1.2 node_modules/async
- chai@3.5.0 node_modules/chai
- cookie@0.3.1 node_modules/cookie
- event-source-polyfill@0.0.7 node_modules/event-source-polyfill
- eventsource@0.2.1 node_modules/eventsource
- jenkins-mocha@3.0.4 node_modules/jenkins-mocha
- jsdoc@3.4.2 node_modules/jsdoc
- mock-require@1.3.0 node_modules/mock-require
- node-mocks-http@1.5.4 node_modules/node-mocks-http
- proxyquire@1.7.10 node_modules/proxyquire
- sinon@1.17.6 node_modules/sinon
- typescript@2.1.5 node_modules/typescript
npm WARN npm-prune-test@1.0.0 No repository field.
npm WARN npm-prune-test@1.0.0 No license field.
avangel@hp-g1:/tmp/0_npm_prune_test$ npm prune --production
- @types/express-serve-static-core@4.0.44 node_modules/@types/express-serve-static-core
- @types/mime@0.0.29 node_modules/@types/mime
- @types/serve-static@1.7.31 node_modules/@types/serve-static
- abbrev@1.0.9 node_modules/abbrev
- amdefine@1.0.1 node_modules/amdefine
- balanced-match@0.4.2 node_modules/balanced-match
- browser-stdout@1.3.0 node_modules/browser-stdout
- camelcase@1.2.1 node_modules/camelcase
- wordwrap@0.0.2 node_modules/cliui/node_modules/wordwrap
- concat-map@0.0.1 node_modules/concat-map
- brace-expansion@1.1.7 node_modules/brace-expansion
- decamelize@1.2.0 node_modules/decamelize
- deep-is@0.1.3 node_modules/deep-is
- diff@1.4.0 node_modules/diff
- escape-string-regexp@1.0.5 node_modules/escape-string-regexp
- esprima@2.7.3 node_modules/esprima
- estraverse@1.9.3 node_modules/estraverse
- esutils@2.0.2 node_modules/esutils
- fast-levenshtein@2.0.6 node_modules/fast-levenshtein
- fs.realpath@1.0.0 node_modules/fs.realpath
- graceful-readlink@1.0.1 node_modules/graceful-readlink
- commander@2.9.0 node_modules/commander
- growl@1.9.2 node_modules/growl
- async@1.5.2 node_modules/handlebars/node_modules/async
- source-map@0.4.4 node_modules/handlebars/node_modules/source-map
- has-flag@1.0.0 node_modules/has-flag
- inherits@2.0.3 node_modules/inherits
- is-buffer@1.1.5 node_modules/is-buffer
- isexe@2.0.0 node_modules/isexe
- async@1.5.2 node_modules/istanbul/node_modules/async
- esprima@3.1.3 node_modules/js-yaml/node_modules/esprima
- json3@3.3.2 node_modules/json3
- kind-of@3.2.2 node_modules/kind-of
- lazy-cache@1.0.4 node_modules/lazy-cache
- lodash._basecopy@3.0.1 node_modules/lodash._basecopy
- lodash._basecreate@3.0.3 node_modules/lodash._basecreate
- lodash._getnative@3.9.1 node_modules/lodash._getnative
- lodash._isiterateecall@3.0.9 node_modules/lodash._isiterateecall
- lodash.isarguments@3.1.0 node_modules/lodash.isarguments
- lodash.isarray@3.0.4 node_modules/lodash.isarray
- lodash.keys@3.1.2 node_modules/lodash.keys
- lodash._baseassign@3.2.0 node_modules/lodash._baseassign
- lodash.create@3.1.1 node_modules/lodash.create
- longest@1.0.1 node_modules/longest
- minimatch@3.0.4 node_modules/minimatch
- minimist@0.0.10 node_modules/minimist
- minimist@0.0.8 node_modules/mkdirp/node_modules/minimist
- mkdirp@0.5.1 node_modules/mkdirp
- supports-color@3.1.2 node_modules/mocha/node_modules/supports-color
- ms@0.7.1 node_modules/ms
- debug@2.2.0 node_modules/debug
- nopt@3.0.6 node_modules/nopt
- wordwrap@0.0.3 node_modules/optimist/node_modules/wordwrap
- optimist@0.6.1 node_modules/optimist
- path-is-absolute@1.0.1 node_modules/path-is-absolute
- prelude-ls@1.1.2 node_modules/prelude-ls
- repeat-string@1.6.1 node_modules/repeat-string
- align-text@0.1.4 node_modules/align-text
- center-align@0.1.3 node_modules/center-align
- resolve@1.1.7 node_modules/resolve
- right-align@0.1.3 node_modules/right-align
- cliui@2.1.0 node_modules/cliui
- source-map@0.2.0 node_modules/source-map
- sprintf-js@1.0.3 node_modules/sprintf-js
- argparse@1.0.9 node_modules/argparse
- js-yaml@3.8.4 node_modules/js-yaml
- supports-color@3.2.3 node_modules/supports-color
- type-check@0.3.2 node_modules/type-check
- levn@0.3.0 node_modules/levn
- source-map@0.5.6 node_modules/uglify-js/node_modules/source-map
- uglify-to-browserify@1.0.2 node_modules/uglify-to-browserify
- which@1.2.14 node_modules/which
- window-size@0.1.0 node_modules/window-size
- wordwrap@1.0.0 node_modules/wordwrap
- optionator@0.8.2 node_modules/optionator
- escodegen@1.8.1 node_modules/escodegen
- wrappy@1.0.2 node_modules/wrappy
- once@1.4.0 node_modules/once
- inflight@1.0.6 node_modules/inflight
- glob@5.0.15 node_modules/glob
- glob@7.0.5 node_modules/mocha/node_modules/glob
- yargs@3.10.0 node_modules/yargs
- uglify-js@2.8.27 node_modules/uglify-js
- handlebars@4.0.8 node_modules/handlebars
- @types/express@4.0.35 node_modules/@types/express
- istanbul@0.4.5 node_modules/istanbul
- mocha@3.1.2 node_modules/mocha
npm WARN npm-prune-test@1.0.0 No repository field.
npm WARN npm-prune-test@1.0.0 No license field.
avangel@hp-g1:/tmp/0_npm_prune_test$ npm prune --production
- @types/node@7.0.4 node_modules/@types/node
npm WARN npm-prune-test@1.0.0 No repository field.
npm WARN npm-prune-test@1.0.0 No license field.
avangel@hp-g1:/tmp/0_npm_prune_test$ 
avangel@hp-g1:/tmp/0_npm_prune_test$ # finally nothing to remove
avangel@hp-g1:/tmp/0_npm_prune_test$ ls -la node_modules/
total 12
drwxr-xr-x 3 avangel avangel 4096 May 19 17:54 .
drwxr-xr-x 3 avangel avangel 4096 May 19 17:54 ..
drwxr-xr-x 2 avangel avangel 4096 May 19 17:54 .bin

supporting information:

npm-robot commented 7 years ago

We're closing this issue as it has gone seven days without activity and without being labeled. If we haven't even labeled in issue in seven days then we're unlikely to ever read it.

If you are still experiencing the issue that led to you opening this or this is a feature request you're still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.