Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: EISDIR when using --babelify #7

Closed
indianscout opened this issue Apr 4, 2016 · 3 comments
Closed

Error: EISDIR when using --babelify #7

indianscout opened this issue Apr 4, 2016 · 3 comments

Comments

@indianscout
Copy link

After a fresh installation, the following error occures:

$ node ./node_modules/es6-to-plv8/cmd.js --namespace DetailContentMigration --file ../stateFromHTML/stateFromHTML.js --outfile ../stateFromHTML/stateFromHTML --definitions ~/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.json --babelify ../stateFromHTML/babelify.json
{ namespace: 'DetailContentMigration',
  file: '../stateFromHTML/stateFromHTML.js',
  outfile: '../stateFromHTML/stateFromHTML',
  wrappers: '',
  definitions: '/home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.json',
  babelify: '../stateFromHTML/babelify.json',
  watch: false,
  db: false }
>>>> Building PLV8 sql file...
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: EISDIR: illegal operation on a directory, read while parsing file: /home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.js
    at Error (native)
    at Object.fs.readSync (fs.js:603:19)
    at Object.fs.readFileSync (fs.js:438:24)
    at OptionManager.addConfig (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:196:35)
    at OptionManager.findConfigs (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:413:16)
    at OptionManager.init (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:461:12)
    at File.initOptions (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/index.js:194:75)
    at new File (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/index.js:123:22)
    at Pipeline.transform (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/pipeline.js:45:16)
    at Babelify._flush (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/index.js:28:24)

I can't actually figure out what exactly is causing this exception but it must be related with babelify.

I've checked all input files and paths an they are all right:

$ ll ../stateFromHTML/stateFromHTML.js
-rw-rw-r-- 1 indianscout indianscout 290 Apr  4 09:29 ../stateFromHTML/stateFromHTML.js
$ ll ~/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.json
-rw-rw-r-- 1 indianscout indianscout 142 Apr  4 09:29 
$ ll ../stateFromHTML/babelify.json
-rw-rw-r-- 1 indianscout indianscout 133 Apr  4 11:30 ../stateFromHTML/babelify.json

Absolute paths do not work either:

indianscout@indianscout45:~/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8$ node es6ToPlv8.js --namespace DetailContentMigration --file /home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.js --outfile /home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML --definitions /home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.json --babelify /home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/babelify.json
{ namespace: 'DetailContentMigration',
  file: '/home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.js',
  outfile: '/home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML',
  wrappers: '',
  definitions: '/home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.json',
  babelify: '/home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/babelify.json',
  watch: false,
  db: false }
>>>> Building PLV8 sql file...
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: EISDIR: illegal operation on a directory, read while parsing file: /home/indianscout/infektweb/guidelines.v4/dbdata/utils/stateFromHTML/stateFromHTML.js
    at Error (native)
    at Object.fs.readSync (fs.js:603:19)
    at Object.fs.readFileSync (fs.js:438:24)
    at OptionManager.addConfig (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:196:35)
    at OptionManager.findConfigs (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:413:16)
    at OptionManager.init (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:461:12)
    at File.initOptions (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/index.js:194:75)
    at new File (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/file/index.js:123:22)
    at Pipeline.transform (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/node_modules/babel-core/lib/transformation/pipeline.js:45:16)
    at Babelify._flush (/home/indianscout/infektweb/guidelines.v4/dbdata/utils/es6ToPlv8/node_modules/babelify/index.js:28:24)
@indianscout
Copy link
Author

Opened an issue at browserify: babel/babelify#193

@jrmerz
Copy link
Member

jrmerz commented Apr 4, 2016

Looks like a babel issue at first glance.

@indianscout
Copy link
Author

Conclusion: independent of --babelify option a .bablerc has to be present. But unfortunately the --babelify option can not be omitted. Workaround: invoke es6-to-plv8 as follows:

node_modules/es6-to-plv8/cmd.js --namespace MyNs --file example.js --outfile example --definitions /path/to/example.json --babelify .babelrc

Just pass the .babelrc with the --babalify option and everything works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants