我正在按照此链接中的说明进行操作:https://ionicframework.com/docs/native/in-app-browser/
在应用浏览器库中安装Cordova插件和Ionic本机后,运行ionic cordova构建android会导致错误:找不到ionic-app-scripts。
如何解决此问题?我试过删除node_modules文件夹并运行npm install,但是它没有用。
我使用的是Ionic 3,Ionic CLI 4.3.1,请在应用程序浏览器插件中安装最新版本。
编辑:安装ionic-native / in-app-browser时,显示如下:
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed.
You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4
(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current{"os":"win32","arch":"x64"})
+ @ionic-native/in-app-browser@4.17.0
added 1 package from 1 contributor and audited 6219 packages in 17.843s
found 6 vulnerabilities (1 low, 5 moderate)
run `npm audit fix` to fix them, or `npm audit` for details
离子信息输出:
Ionic:
ionic (Ionic CLI) : 4.3.1
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0
Cordova Plugins : no whitelisted plugins (0 plugins total)
System:
NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 7
构建时出错:
ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
'ionic-app-scripts' is not recognized as an internal or external command,
operable program or batch file.
[INFO] Looks like @ionic/app-scripts isn't installed in this project.
This package is required for this command to work properly.
? Install @ionic/app-scripts? Yes
> npm i -D -E @ionic/app-scripts
npm WARN deprecated cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ @ionic/app-scripts@3.2.0
updated 1 package and audited 6219 packages in 31.422s
found 6 vulnerabilities (1 low, 5 moderate)
run `npm audit fix` to fix them, or `npm audit` for details
> ionic-app-scripts build --target cordova --platform android
'ionic-app-scripts' is not recognized as an internal or external command,
operable program or batch file.
[ERROR] ionic-app-scripts command not found.