Skip to content

Instantly share code, notes, and snippets.

@slaskis
Created November 22, 2011 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaskis/1385771 to your computer and use it in GitHub Desktop.
Save slaskis/1385771 to your computer and use it in GitHub Desktop.
NPM throws an error when using the outdated() API method after using ls().
/Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/lib/cache.js:212
var p = url.parse(spec.replace(/^git\+/, "git")) || {}
^
TypeError: Object #<Object> has no method 'replace'
at add (/Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/lib/cache.js:212:26)
at Function.add (/Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/lib/cache.js:174:10)
at shouldUpdate (/Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/lib/outdated.js:141:9)
at /Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/lib/outdated.js:115:7
at /Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/node_modules/slide/lib/async-map.js:54:35
at Array.forEach (native)
at /Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/node_modules/slide/lib/async-map.js:54:11
at Array.forEach (native)
at asyncMap (/Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/node_modules/slide/lib/async-map.js:53:8)
at next (/Users/slaskis/Desktop/Ideas/nodepress/node_modules/npm/lib/outdated.js:114:5)
var npm = require('npm');
npm.load(function(){
npm.commands.ls() // if removed it doesn't throw
npm.commands.outdated()
})
{
"author": "Robert Sköld <robert@publicclass.se>",
"name": "fail",
"description": "A test case with npm",
"version": "0.1.0",
"dependencies": {
"npm": "~1.0.106"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment