alexanderGugel / ied

:package: Like npm, but faster - an alternative package manager for Node
http://alexandergugel.github.io/ied
MIT License
1.99k stars 53 forks source link

ied fails when using git repository links instead of npm versions #149

Closed havarnov closed 8 years ago

havarnov commented 8 years ago

It seems like ied doesn't handle links to repositories. The following package.json file reproduces the bug:

{
  "name": "ied-error",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "grunt-manifest": "https://github.com/gunta/grunt-manifest/tarball/master"
  }
}

Running ied install on that package.json results in the following error:

/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/rxjs/Observer.js:5
    error: function (err) { throw err; },
                            ^

AssertionError: error status code https://registry.npmjs.org/grunt-manifest/https://github.com/gunta/grunt-manifest/tarball/master: undefined
    at checkStatus (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/lib/registry.js:97:20)
    at SafeSubscriber._next (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/lib/registry.js:134:12)
    at SafeSubscriber.__tryOrSetError (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/rxjs/Subscriber.js:232:16)
    at SafeSubscriber.next (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/rxjs/Subscriber.js:174:27)
    at Subscriber._next (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/rxjs/Subscriber.js:125:26)
    at Subscriber.next (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/rxjs/Subscriber.js:89:18)
    at DoSubscriber._next (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/rxjs/operator/do.js:82:24)
    at DoSubscriber.Subscriber.next (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/rxjs/Subscriber.js:89:18)
    at /Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/lib/util.js:109:14
    at done (/Users/havarnov/.nvm/versions/node/v4.4.5/lib/node_modules/ied/node_modules/needle/lib/needle.js:377:14)
hung-phan commented 8 years ago

I had the same problem.

alexanderGugel commented 8 years ago

This was due to a bug in the resolve step. Instead of using the cwd, the __dirname of ied itself was used instead.

npm install -g ied

should fix it! Sorry for the delay!

(00744560e0ab44ea95d1fd8c626f6998c2587fdb)