【问题标题】:Ionic is Not Installing on Windows 7 - Getting Many ErrorsIonic 未在 Windows 7 上安装 - 出现很多错误
【发布时间】:2015-11-25 04:58:13
【问题描述】:

我在尝试安装 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

【问题讨论】:

    标签: android node.js cordova installation ionic


    【解决方案1】:

    请按照以下步骤安装 ionic。

    离子设置

    设置环境(安装)

    1. 安装 Node.js

      一个。 http://nodejs.org/download/

    2. 安装离子框架

      一个。 $ npm install -g cordova ionic

    3. 安装android SDK并设置环境变量

      一个。设置以下环境变量

      b.设置 ANDROID_HOME=C:\\android-sdk-windows

    安装 Android Target 19(按照以下步骤操作)

    1. 打开 SDK 管理器(在终端中输入 android,假设它在您的文件路径中)
    2. Android 4.4.2 (API 19) 旁边的选中框
    3. 点击按钮安装 8 个包

    使用 CMD 窗口安装 ant

    1. npm 安装 -g ant

      一个。在环境变量(PATH)中添加以下路径: C:\Users\user.name\AppData\Roaming\npm\node_modules\ant\ant\bin

    一旦你设置了离子环境。 创建用于测试的基本应用程序。

    1. 打开 node.js 命令提示符
    2. ionic 启动 myApp 选项卡
    3. cd myApp
    4. ionic serve(它将在浏览器中打开应用程序)
    5. 离子平台添加android(如果要添加iOS平台,请将ios替换为android)
    6. ionic build android(如果要在 iOS 平台上构建,请将 ios 替换为 android)
    7. ionic emulate android android(如果要模拟 iOS 平台,请将 ios 替换为 android)

    注意:如果发生 ERR,请点击以下链接: installing ionic npm ERR! tar.unpack error

    【讨论】:

      【解决方案2】:

      您是否遵循了正确的安装顺序?

      安装或更新 Node.js

      下载最新版本的Node.js。如果您运行的是旧版本的 Node,请务必更新它,因为旧版本存在 npm 问题。

      与其他命令一样,nodejs 现在应该在 cmd.exe 中运行,但要小心,请将 Node 中 bin 文件夹的完整路径添加到您的 PATH,它看起来类似于 @987654328 @

      安装 Cordova

      打开一个新的cmd.exe 窗口,然后运行:

      $ npm install -g cordova
      

      安装 Ionic

      $ npm install -g ionic
      

      也可以找到官方安装docthis 了解更多信息。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-09-13
        • 1970-01-01
        • 1970-01-01
        • 2014-08-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-03-21
        相关资源
        最近更新 更多