dependencies can not be found when using npm ls api #4637

Closed
guo-yu opened this Issue Feb 9, 2014 · 2 comments

Comments

Projects
None yet
5 participants
@guo-yu

guo-yu commented Feb 9, 2014

It seems happens when npm.commands.ls fired more than once.

codes below:

var npm = require("npm");

var config = {};
config.loglevel = 'silent';
config.parseable = true;

npm.load(config, function() {
    npm.commands.ls([], true, function(err, module, tree){
        console.log(tree);
    });
    npm.commands.ls([], true, function(err, module, tree){
        console.log(tree);
    });
});

I've print the third param of npm.command.ls callback, and here are the results:

// the second fire can not found deps in local node_modules folder
{ name: 'pkghub',
  version: '0.0.3',
  problems:
   [ 'missing: underscore@*, required by pkghub@0.0.3',
     'missing: glob@*, required by pkghub@0.0.3' ],
  dependencies:
   { underscore: { required: '*', missing: true },
     glob: { required: '*', missing: true } } }
// first fire
{ name: 'pkghub',
  version: '0.0.3',
  dependencies:
   { underscore: { version: '1.5.2', from: 'underscore@*' },
     glob: { version: '3.2.8', from: 'glob@*', dependencies: [Object] },
     should: { version: '3.1.2', from: 'should@*' },
     mocha: { version: '1.17.1', from: 'mocha@*', dependencies: [Object] } } }

have someone ever meet this kind of problems ? thanks a lot !

@swang

This comment has been minimized.

Show comment Hide comment
@swang

swang Jan 24, 2015

It seems like this was a bug in the older versions of npm, so it can probably be closed as fixed.

npm 1.3.26

{ problems: 
   [ 'missing: coffee-script@*, required by undefined@undefined',
     'missing: npm@*, required by undefined@undefined' ],
  dependencies: 
   { 'coffee-script': { required: '*', missing: true },
     npm: { required: '*', missing: true } } }
{ problems: 
   [ 'missing: lru-cache@2, required by minimatch@0.2.14',
     'missing: abbrev@1, required by nopt@2.1.2',
     'missing: mime@~1.2.11, required by form-data@0.1.2',
     'missing: hoek@0.9.x, required by boom@0.4.2',
     'missing: boom@0.4.x, required by cryptiles@0.2.2',
     'missing: hoek@0.9.x, required by sntp@0.2.4',
     'missing: inherits@2, required by tar@0.1.19',
     'missing: block-stream@*, required by tar@0.1.19',
     'missing: fstream@~0.1.8, required by tar@0.1.19',
     'missing: rimraf@2, required by fstream@0.1.25',
     'missing: mkdirp@0.3, required by fstream@0.1.25',
     'missing: graceful-fs@~2.0.0, required by fstream@0.1.25',
     'missing: inherits@~2.0.0, required by fstream@0.1.25',
     'missing: inherits@~2.0.0, required by block-stream@0.0.7',
     'missing: glob@3, required by node-gyp@0.12.2',
     'missing: graceful-fs@2, required by node-gyp@0.12.2',
     'missing: fstream@0, required by node-gyp@0.12.2',
     'missing: minimatch@0, required by node-gyp@0.12.2',
     'missing: mkdirp@0, required by node-gyp@0.12.2',
     'missing: nopt@2, required by node-gyp@0.12.2',
     'missing: npmlog@0, required by node-gyp@0.12.2',
     'missing: osenv@0, required by node-gyp@0.12.2',
     'missing: request@2, required by node-gyp@0.12.2',
     ......
     'extraneous: inherits@2.0.1 /Users/Projects/javascript/node_modules/npm/node_modules/inherits',
     'extraneous: normalize-package-data@1.0.3 /Users/Projects/javascript/node_modules/npm/node_modules/normalize-package-data' ],
  dependencies: 
   { 'coffee-script': 
      { version: '1.8.0',
        from: 'coffee-script',
        dependencies: [Object] },
     npm: 
      { version: '1.3.26',
        from: 'npm@1.3.26',
        resolved: 'https://registry.npmjs.org/npm/-/npm-1.3.26.tgz',
        problems: [Object],
        dependencies: [Object] } } }

vs

npm 2.4.1

{ dependencies: 
   { 'coffee-script': 
      { version: '1.8.0',
        from: 'coffee-script',
        dependencies: [Object] },
     npm: 
      { version: '2.4.1',
        from: 'npm',
        resolved: 'file:npm',
        dependencies: [Object] } } }
{ dependencies: 
   { 'coffee-script': 
      { version: '1.8.0',
        from: 'coffee-script',
        dependencies: [Object] },
     npm: 
      { version: '2.4.1',
        from: 'npm',
        resolved: 'file:npm',
        dependencies: [Object] } } }

swang commented Jan 24, 2015

It seems like this was a bug in the older versions of npm, so it can probably be closed as fixed.

npm 1.3.26

{ problems: 
   [ 'missing: coffee-script@*, required by undefined@undefined',
     'missing: npm@*, required by undefined@undefined' ],
  dependencies: 
   { 'coffee-script': { required: '*', missing: true },
     npm: { required: '*', missing: true } } }
{ problems: 
   [ 'missing: lru-cache@2, required by minimatch@0.2.14',
     'missing: abbrev@1, required by nopt@2.1.2',
     'missing: mime@~1.2.11, required by form-data@0.1.2',
     'missing: hoek@0.9.x, required by boom@0.4.2',
     'missing: boom@0.4.x, required by cryptiles@0.2.2',
     'missing: hoek@0.9.x, required by sntp@0.2.4',
     'missing: inherits@2, required by tar@0.1.19',
     'missing: block-stream@*, required by tar@0.1.19',
     'missing: fstream@~0.1.8, required by tar@0.1.19',
     'missing: rimraf@2, required by fstream@0.1.25',
     'missing: mkdirp@0.3, required by fstream@0.1.25',
     'missing: graceful-fs@~2.0.0, required by fstream@0.1.25',
     'missing: inherits@~2.0.0, required by fstream@0.1.25',
     'missing: inherits@~2.0.0, required by block-stream@0.0.7',
     'missing: glob@3, required by node-gyp@0.12.2',
     'missing: graceful-fs@2, required by node-gyp@0.12.2',
     'missing: fstream@0, required by node-gyp@0.12.2',
     'missing: minimatch@0, required by node-gyp@0.12.2',
     'missing: mkdirp@0, required by node-gyp@0.12.2',
     'missing: nopt@2, required by node-gyp@0.12.2',
     'missing: npmlog@0, required by node-gyp@0.12.2',
     'missing: osenv@0, required by node-gyp@0.12.2',
     'missing: request@2, required by node-gyp@0.12.2',
     ......
     'extraneous: inherits@2.0.1 /Users/Projects/javascript/node_modules/npm/node_modules/inherits',
     'extraneous: normalize-package-data@1.0.3 /Users/Projects/javascript/node_modules/npm/node_modules/normalize-package-data' ],
  dependencies: 
   { 'coffee-script': 
      { version: '1.8.0',
        from: 'coffee-script',
        dependencies: [Object] },
     npm: 
      { version: '1.3.26',
        from: 'npm@1.3.26',
        resolved: 'https://registry.npmjs.org/npm/-/npm-1.3.26.tgz',
        problems: [Object],
        dependencies: [Object] } } }

vs

npm 2.4.1

{ dependencies: 
   { 'coffee-script': 
      { version: '1.8.0',
        from: 'coffee-script',
        dependencies: [Object] },
     npm: 
      { version: '2.4.1',
        from: 'npm',
        resolved: 'file:npm',
        dependencies: [Object] } } }
{ dependencies: 
   { 'coffee-script': 
      { version: '1.8.0',
        from: 'coffee-script',
        dependencies: [Object] },
     npm: 
      { version: '2.4.1',
        from: 'npm',
        resolved: 'file:npm',
        dependencies: [Object] } } }
@busches

This comment has been minimized.

Show comment Hide comment
@busches

busches Sep 26, 2016

@KenanY per @swang this appears to be fixed in npm@2

busches commented Sep 26, 2016

@KenanY per @swang this appears to be fixed in npm@2

@KenanY KenanY closed this Sep 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment