我尝试按照以下步骤在Moodle's ionic mobile app locally上构建Windows:
cd project-directory
ionic platform add android
命令提示符返回以下错误:
Updated the hooks directory to have execute permissions Adding android project... Running command: cmd "/s /c "C:\Users\zameer\.cordova\lib\npm_cache\cordova-andr oid\4.1.1\package\bin\create.bat D:\ionic\moodlemobile2-master\moodlemobile2-mas ter\platforms\android com.moodle.moodlemobile "Moodle Mobile" --cli"" Creating Cordova project for the Android platform: Path: platforms\android Package: com.moodle.moodlemobile Name: Moodle Mobile Activity: MainActivity Android target: android-22 Copying template files... Android project created with cordova-android@4.1.1 Running command: "C:\Program Files\nodejs\node.exe" D:\ionic\moodlemobile2-maste r\moodlemobile2-master\hooks\after_prepare\010_add_platform_class.js D:\ionic\mo odlemobile2-master\moodlemobile2-master add to body class: platform-android Running command: "C:\Program Files\nodejs\node.exe" D:\ionic\moodlemobile2-maste r\moodlemobile2-master\hooks\after_prepare\020_add_ios_transport_security.js D:\ ionic\moodlemobile2-master\moodlemobile2-master module.js:338 throw err; ^ Error: Cannot find module 'plist' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (D:\ionic\moodlemobile2-master\moodlemobile2-master\ho oks\after_prepare\020_add_ios_transport_security.js:10:13) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) Error: Hook failed with error code 1: D:\ionic\moodlemobile2-master\moodlemobile 2-master\hooks\after_prepare\020_add_ios_transport_security.js
所有似乎正常,直到上面错误块的下面部分:
throw err;
^
Error: Cannot find module 'plist'
我的目标是在本地运行此项目,以查看ionic的实际操作
这个
plist
模块是什么?为什么没有被发现?
答案 0 :(得分:9)
在克隆包含Ionic应用程序的Git存储库之后,您需要运行以下两个附加命令:
npm install
它将在本地node_modules
文件夹中安装所有 Node.js 依赖项。考虑的模块是位于克隆Git存储库根目录的dependencies
文件中devDependencies
和package.json
下列出的模块。
ionic state restore
此命令查看cordovaPlugins
文件中的cordovaPlatforms
和package.json
属性,并安装应用程序所需的其他平台和插件代码。
答案 1 :(得分:2)