jspm / npm

NPM Location Service
19 stars 34 forks source link

Error: cannot read property 'tarball' of undefined #108

Closed bioball closed 8 years ago

bioball commented 8 years ago

I'm attempting to run a jspm install, and am getting this error below. Maybe due to #100?

warn Error on download for npm:babel-core
     TypeError: Cannot read property 'tarball' of undefined
         at NPMLocation.download (/usr/local/lib/node_modules/jspm/node_modules/jspm-npm/lib/npm.js:329:45)
         at then.then.active (/usr/local/lib/node_modules/jspm/lib/registry.js:117:30)
         at lib$rsvp$$internal$$tryCatch (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:493:16)
         at lib$rsvp$$internal$$invokeCallback (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:505:17)
         at /usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:1001:13
         at Object.lib$rsvp$asap$$flush [as _onImmediate] (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:1198:9)
         at processImmediate [as _immediateCallback] (timers.js:345:15)

err  Error downloading npm:babel-core.
bioball commented 8 years ago

Update: originally, I had the dependency listed in my package.json as such:

  "jspm": {
    "dependencies": {
      "babel": "npm:babel-core@^5.6.4",
      "babel-core": "npm:babel-core@^5.6.4",
      "clean-css": "npm:clean-css@^3.3.5",
      etc...
    }

I then tried to run an individual jspm install npm:babel-core, then ran jspm install again. Now I have other errors, but at least am not seeing the TypeError.

guybedford commented 8 years ago

Thanks for posting. This does sound like it could be related to #100. Aiming for a release on that soon, and then let me know if you see the issue again.

mwq27 commented 8 years ago

I'm getting this same error, using jspm version 0.16.15. I ran jspm install npm:babel-core and got this output:

warn Error on download for npm:babel-core
     TypeError: Cannot read property 'tarball' of undefined
         at NPMLocation.download (/Users/mwoodson/Projects/enjoymint-html/node_modules/jspm/node_modules/jspm-npm/lib/npm.js:329:45)
         at /Users/mwoodson/Projects/enjoymint-html/node_modules/jspm/lib/registry.js:117:30
         at lib$rsvp$$internal$$tryCatch (/Users/mwoodson/Projects/enjoymint-html/node_modules/rsvp/dist/rsvp.js:493:16)
         at lib$rsvp$$internal$$invokeCallback (/Users/mwoodson/Projects/enjoymint-html/node_modules/rsvp/dist/rsvp.js:505:17)
         at /Users/mwoodson/Projects/enjoymint-html/node_modules/rsvp/dist/rsvp.js:1001:13
         at lib$rsvp$asap$$flush (/Users/mwoodson/Projects/enjoymint-html/node_modules/rsvp/dist/rsvp.js:1198:9)
         at doNTCallback0 (node.js:408:9)
         at process._tickCallback (node.js:337:13)

err  Error downloading npm:babel-core.

err  Error downloading loader files.
mwq27 commented 8 years ago

Update:
I updated babel to a newer version 6.3.17 (previously it was 5.6.17).

mfidemraizer commented 8 years ago

@guybedford Hey ;)

In my case, I'm still experiencing the whole issue.

AFAIK, in Node 4.x the issue isn't happening, but in another machine where I've installed Node 5.x it's happening again.

For now I'll downgrade Node version to latest 4.x... but is there any other solution to solve this?

Update

Well, in fact Node 4.3.1 is affected too. The other machine has Node 4.2.3 with no issues...

Update 2

Sorry, now I'm also experiencing the same issue in the machine of Node 4.2.3......................

Update 3

This is ever more strange. It's happening when I run Node.exe from Powershell. If I run from a .cmd script the problem is fixed...

guybedford commented 8 years ago

If it's possible to share any type of replication here that would help a lot. Is it only happening on Windows then?

mfidemraizer commented 8 years ago

Hey, sorry, I had to update this issue...

Finally it was a symptom of other issue which was my own fault.

Some weeks ago I was editing the config.js to test some things and I left the .js extension in babel-core shims. Something like babel-core@xxxx.js.

Once I removed that, the issue was solved.

BTW, today I've published another issue on JSPM-CLI about how local JSPM cache/config is stored in Windows: https://github.com/jspm/jspm-cli/issues/1582

It's big problem, because when I removed the so-called .js extensing from the map the issue got solved when I manually removed .jspm folder in AppData...

HongJheLi commented 8 years ago

same problem? I'm using jspm 0.16.31 in Windows 7.

When I try to jspm install

warn Error on download for npm:ansi-styles
     TypeError: Cannot read property 'tarball' of undefined

err  Error downloading npm:ansi-styles.
guybedford commented 8 years ago

@HongJheLi does this happen for just jspm install npm:ansi-styles? Does it happen every time? What shell are you using?

HongJheLi commented 8 years ago

@guybedford Thanks. I have package.json which contains jspm dependencies, so I just run jspm install to restore all packages.

It works when I run jspm install npm:ansi-styles, but I don't need it in my project.

The final solution is jspm init -p to reset properties, and it works!

Maybe the problem is I upgraded jspm version from 0.16.X to the latest?

guybedford commented 8 years ago

Thanks for clarifying. So this definitely has something to do with messed up configuration. If it's possible to share what that exact configuration difference is that would help.

weegeekps commented 8 years ago

I was just grappling with this same issue. It turned out that foundation-sites has chalk as a dependency, and a few days ago chalk/ansi-styles unpublished a new version which in turn messed a lot of folks up. In my case (and possibly @HongJheLi's case as well) I managed to get that 2.2.0 version which was unpublished.

To fix, I searched through my config.js and updated every reference of npm:ansi-styles@2.2.0 to npm:ansi-styles@2.2.1. Works like a charm now.

HongJheLi commented 8 years ago

Thanks @weegeekps

It solves the issue.

config.js
"npm:chalk@1.1.1": {
      "ansi-styles": "npm:ansi-styles@2.2.0 => 2.2.1",
      "escape-string-regexp": "npm:escape-string-regexp@1.0.5",
      "has-ansi": "npm:has-ansi@2.0.0",
      "process": "github:jspm/nodelibs-process@0.1.2",
      "strip-ansi": "npm:strip-ansi@3.0.1",
      "supports-color": "npm:supports-color@2.0.0"
    },
Qix- commented 8 years ago

Sorry if this inconvenienced anyone. Won't happen again.