离子不在Windows 7上安装 – 获取许多错误
我正在尝试安装Ionic时遇到此错误
$ npm install ionic cordova -g npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.2","npm":"2.14.7"}) npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\delayed-stream\0.0.5\package.tgz npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "cordova" "-g" npm ERR! node v4.2.2 npm ERR! npm v2.14.7 npm ERR! path C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed npm ERR! code UNKNOWN npm ERR! errno -4094 npm ERR! syscall scandir npm ERR! UNKNOWN: unknown error, scandir 'C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed' npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! error rolling back Error: UNKNOWN: unknown error, scandir 'C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed' npm ERR! error rolling back at Error (native) npm ERR! error rolling back { [Error: UNKNOWN: unknown error, scandir 'C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed'] npm ERR! error rolling back errno: -4094, npm ERR! error rolling back code: 'UNKNOWN', npm ERR! error rolling back syscall: 'scandir', npm ERR! error rolling back path: 'C:\\Users\\Sridhar\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules\\npm\\node_modules\\read-installed' } npm ERR! Please include the following file with any support request: npm ERR! C:\Users\Sridhar\npm-debug.log
请帮我安装Ionic
请按照以下步骤安装离子。
IONIC设置
安装环境(安装)
-
安装Node.js
-
安装ionic framework
一个。 $ npm install -g cordova离子
-
安装android SDK并设置环境variables
一个。 设置以下环境variables
湾 设置ANDROID_HOME = C:\\ android-sdk-windows
安装Android Target 19(按照以下步骤操作)
- 打开SDKpipe理器(在terminal中inputandroid,假设它在你的文件path中)
- Android 4.4.2(API 19)旁边的选定框
- 点击button安装8包
使用CMD窗口安装ant
-
npm安装-g ant
一个。 在环境variables(PATH)中添加以下path:C:\ Users \ user.name \ AppData \ Roaming \ npm \ node_modules \ ant \ ant \ bin
一旦你设置离子环境。 创buildtesting的基本应用程序。
- 打开node.js命令提示符
- 离子启动myApp选项卡
- 光盘myApp
- 离子服务(它将在浏览器中打开应用程序)
- 离子平台添加android(用iosreplaceandroid如果你想添加iOS平台)
- 离子构buildandroid(如果你想在iOS平台上构build,用androidreplaceios)
- 离子模拟android的android(如果你想模拟iOS平台,用androidreplaceios)
注意:如果发生ERR,请按照下面的链接: 安装ionic npm ERR! tar.unpack错误
你是否按照正确的安装顺序?
安装或更新Node.js
下载最新版本的Node.js。 如果您正在运行较旧版本的Node,请确保更新它,因为旧版本与npm有问题。
与其他命令一样, nodejs
现在应该在cmd.exe
运行,但要小心,将Node中bin
文件夹的完整path添加到PATH
,该PATH
看起来像C:\Program Files\nodejs\bin
安装Cordova
打开一个新的cmd.exe
窗口,然后运行:
$ npm install -g cordova
安装离子
$ npm install -g ionic
find官方安装文档 , 这也是更多。