Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Using "requireCordovaModule" to load non-cordova module "fs" is not supported. Instead, add this module to your dependencies and use regular "require" to load it. #247

Open
MrChen-Fly opened this issue Apr 9, 2019 · 5 comments · May be fixed by #249

Comments

@MrChen-Fly
Copy link

Obsolete content.requireCordovaModule('q')

Should use require('q')

by cordova@^9

@shahdeep1989
Copy link

I am facing same issue. Please check details and if there is any solution please tell me.

  • android 8.0.0
  • Cordova 9.0.0

Here is log:
Failed to install 'cordova-plugin-crosswalk-webview-v2': CordovaError: Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
at Context.requireCordovaModule (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/Context.js:57:15)
at module.exports (/Applications/MAMP/htdocs/Client'sProject/AndreaDotti-Footballgame/App GiocoCalciando/plugins/cordova-plugin-crosswalk-webview-v2/hooks/after_plugin_install/000-shared_mode_special.js:6:28)
at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:181:32)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:125:20
at process.internalTickCallback (internal/process/next_tick.js:77:7)
Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

Can someone provide me solution?

@MrChen-Fly
Copy link
Author

我面临同样的问题。请查看详细信息,如果有任何解决方案,请告诉我。

  • android 8.0.0
  • Cordova 9.0.0

这是log:
无法安装'cordova-plugin-crosswalk-webview-v2':CordovaError:不支持使用“requireCordovaModule”加载非cordova模块“q”。相反,将此模块添加到您的依赖项并使用常规“require”来加载它。

context.requireCordovaModule (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/Context.js:57:15)上的module.exports(/ Applications / MAMP / htdocs / Client'sProject /) AndreaDotti-Footballgame / App GiocoCalciando / plugins / cordova-plugin-crosswalk-webview-v2 / hooks / after_plugin_install / 000-shared_mode_special.js:6:28)
at runScriptViaModuleLoader(/ usr / local / lib / node_modules / cordova / node_modules / cordova -lib / SRC /钩/ HooksRunner.js:181:32)
at runScript(/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
at / usr / local / lib / node_modules / cordova / node_modules / cordova-lib / src / hooks / HooksRunner.js:125:20
at process.internalTickCallback(internal / process / next_tick.js:77:7)
不支持使用“requireCordovaModule”加载非cordova模块“q”。相反,将此模块添加到您的依赖项并使用常规“require”来加载它。

有人能为我提供解决方案吗

I'm not good at English

You need to modify the files under the folder。 ==》 hooks

Modify some parts and execute build again.

E.g
context.requireCordovaModule('q') changed to require('q')
context.requireCordovaModule('fs') changed to require('fs')

@shahho
Copy link

shahho commented May 30, 2019

我面临同样的问题。请查看详细信息,如果有任何解决方案,请告诉我。

  • android 8.0.0
  • Cordova 9.0.0

这是log:
无法安装'cordova-plugin-crosswalk-webview-v2':CordovaError:不支持使用“requireCordovaModule”加载非cordova模块“q”。相反,将此模块添加到您的依赖项并使用常规“require”来加载它。

context.requireCordovaModule (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/Context.js:57:15)上的module.exports(/ Applications / MAMP / htdocs / Client'sProject /) AndreaDotti-Footballgame / App GiocoCalciando / plugins / cordova-plugin-crosswalk-webview-v2 / hooks / after_plugin_install / 000-shared_mode_special.js:6:28)
at runScriptViaModuleLoader(/ usr / local / lib / node_modules / cordova / node_modules / cordova -lib / SRC /钩/ HooksRunner.js:181:32)
at runScript(/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
at / usr / local / lib / node_modules / cordova / node_modules / cordova-lib / src / hooks / HooksRunner.js:125:20
at process.internalTickCallback(internal / process / next_tick.js:77:7)
不支持使用“requireCordovaModule”加载非cordova模块“q”。相反,将此模块添加到您的依赖项并使用常规“require”来加载它。
有人能为我提供解决方案吗

I'm not good at English

You need to modify the files under the folder。 ==》 hooks

Modify some parts and execute build again.

E.g
context.requireCordovaModule('q') changed to require('q')
context.requireCordovaModule('fs') changed to require('fs')

我不是好的在英语
你需要修改文件夹下的文件 ==》 钩子
修改某些部分并再次执行build。

requirecordovamodule ('q')更改为require('q')
requirecordovamodule ('fs')更改为require('fs')

可能是进入
project - plugins - any.js ...

@YES-Lee
Copy link

YES-Lee commented Aug 14, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants
@shahho @shahdeep1989 @YES-Lee @MrChen-Fly and others