jspm / npm

NPM Location Service
19 stars 34 forks source link

error using jison: package.json.js not found #105

Closed adamburgess closed 8 years ago

adamburgess commented 8 years ago

I think this is the correct repository, seeing as I think it should handle require()ing json files.

main.js:

import jison from 'jison'
export default {}

steps to reproduce:

jspm install npm:jison
jspm run main

expected output: none actual output:

err  Error: ENOENT: no such file or directory, open '[redacted]\jspm-test\jspm_packages\npm\jison@0.4.15\package.json.js'
         at Error (native)
        Error loading file:///[redacted]/jspm-test/jspm_packages/npm/jison@0.4.15/package.json.js as "../package.json" from file:///[redacted]/jspm-test/jspm_packages/npm/jison@0.4.15/lib/jison.js

jspm version: 0.16.15 (I am unsure whether this is fixed in 0.17, as commands using the cli open jspm.js?)

jison requires ../package.json. Could using the parent directory have thrown something off?

guybedford commented 8 years ago

Thanks. I managed to trace this down to the issue fixed in https://github.com/zaach/jison/commit/b9d567317aa91bb1b6462bef5671623216673711.

We use Traceur to parse sources, which doesn't support that label statement.

So this should work with the next release of jison, or you can install directly from the github repo with:

  jspm install github:zaach/jison@master -o "{registry:'npm'}"

which should work, but let me know if you have any further issues.