qooxdoo / qooxdoo-compiler

Compiler for Qooxdoo, 100% javascript
MIT License
36 stars 23 forks source link

Error: Cannot find module 'babel-plugin-transform-es2015-template-literals' #28

Closed sbhtw closed 7 years ago

sbhtw commented 7 years ago

Don't know if it's rather an issue of qx-cli, but for now I post it here:

When running a fresh npm install (without any existing node_modules/) with this package.json:

{
  "name": "myproject",
  "version": "0.1.0",
  "repository": {},
  "devDependencies": {
    "babel-cli": "^6.14.0",
    "babel-loader": "^6.2.5",
    "babel-preset-babili": "0.0.3",
    "babel-preset-es2015": "^6.14.0",
    "babel-preset-es2016": "^6.11.3",
    "eslint": "^3.19.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-plugin-import": "^2.3.0",
    "eslint-plugin-node": "^5.0.0",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-standard": "^3.0.1",
    "grunt": "~0.4.2",
    "grunt-contrib-clean": "~0.5.0",
    "webpack": "^1.13.2"
  },
  "dependencies": {
    "path": "^0.12.7"
  }
}

and then running npm install --save-dev qx-cli, resulting in the new package.json:

{
  "name": "myproject",
  "version": "0.1.0",
  "repository": {},
  "devDependencies": {
    "babel-cli": "^6.14.0",
    "babel-loader": "^6.2.5",
    "babel-preset-babili": "0.0.3",
    "babel-preset-es2015": "^6.14.0",
    "babel-preset-es2016": "^6.11.3",
    "eslint": "^3.19.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-plugin-import": "^2.3.0",
    "eslint-plugin-node": "^5.0.0",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-standard": "^3.0.1",
    "grunt": "~0.4.2",
    "grunt-contrib-clean": "~0.5.0",
    "qx-cli": "^0.1.24",
    "webpack": "^1.13.2"
  },
  "dependencies": {
    "path": "^0.12.7"
  }
}

I get an error when running ./node_modules/.bin/qx compile:

2017-09-07 11:29:16.794 >>> Making the applications...
module.js:491
    throw err;
    ^

Error: Cannot find module 'babel-plugin-transform-es2015-template-literals' 
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18) 
    at /home/user/devel/frontend/myproject/node_modules/qxcompiler/lib/qxcompiler/ClassFile.js:250:13
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)

Adding babel-plugin-transform-es2015-template-literals to the Dependencies of qooxdoo-compiler in node_modules/qxcompiler/package.json (as a workaround) fixes this error, but then qx complains about the next missing module (see ClassFile.js)

johnspackman commented 7 years ago

Is it that you've created a new node application and you want to use the qooxdoo-compiler API? In which case, you would npm install qxcompiler and not install qx-cli.

Can you elaborate on what you're trying to achieve? Im confused because you would only need the babel* dependencies if you intend on interacting with babel directly, for example if you're writing your own babel plugin ... and if that was the case, I'm not sure that you'd want to write a babel plugin and use qxcompiler, much less qx-cli as a dependent module.

sbhtw commented 7 years ago

Sorry for being so light on details :-)

I have an existing qooxdoo application and switched from generate.py to qx-cli. It worked fine, until I had to rebuild the node_modules folder (for some other reasons). Since then I get the error as described.

The other dependencies in package.json are remains from some older experiments of using babel directly. I try to start from scratch and will report here again.

sbhtw commented 7 years ago

Ok, the error could be fixed by uninstalling all "babel*" dependencies (package.json and node_modules).

Don't know why they conflicted with qx-cli/qxcompiler.

Thanks!

sbhtw commented 7 years ago

Just a last comment:

thank you for you effort, @johnspackman. qx-compiler is great and the transition was almost effortless, which was very surprising to me. Worked almost "out-of-the-box".

Keep up the good work!

johnspackman commented 7 years ago

if you just want to use the compiler, you do not have to create a new node application - the qx-cli is designed to work standalone. All you need to do is this:

npm install -g qx-cli

More details in the readme at https://github.com/qooxdoo/qooxdoo-cli

johnspackman commented 7 years ago

PS we have a chat room here in case that helps https://gitter.im/qooxdoo/qxcompiler

sbhtw commented 7 years ago

@johnspackman due to deployment reasons, I didn't want to install qx-cli globally.