安装Ionic2

时间:2016-12-14 15:23:16

标签: cordova npm ionic2

我正在尝试安装ionic@2.0.0-beta.11,但是我收到以下错误。

我不介意我必须重新安装nodecordova。有没有人对我成功安装ionic@2.0.0-beta.11需要做些什么有什么想法?

由于

npm install -g ionic@2.0.0-beta.11
C:\Users\Richard\AppData\Roaming\npm\ionic -> C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\bin\ionic

> node-sass@3.4.2 install C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass
> node scripts/install.js

Cannot download "https://github.com/sass/node-sass/releases/download/v3.4.2/win32-x64-48_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> spawn-sync@1.0.14 postinstall C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\cross-spawn\node_modules\spawn-sync
> node postinstall


> node-sass@3.4.2 postinstall C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\Richard\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules\\ionic-app-lib\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.2.1
gyp info using node@6.9.2 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at F (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:78:19)
gyp verb `which` failed     at E (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:82:29)
gyp verb `which` failed     at C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:93:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at F (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:78:19)
gyp verb `which` failed     at E (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:82:29)
gyp verb `which` failed     at C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:93:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at F (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:78:19)
gyp verb `which` failed     at E (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:82:29)
gyp verb `which` failed     at C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:93:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at F (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:78:19)
gyp verb `which` failed     at E (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:82:29)
gyp verb `which` failed     at C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:93:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Richard\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules\\ionic-app-lib\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
Build failed
- cordova-lib node_modules\ionic\node_modules\ionic-app-lib\node_modules\cordova-lib
- cordova-js node_modules\ionic\node_modules\ionic-app-lib\node_modules\cordova-lib\node_modules\cordova-js
- browserify node_modules\ionic\node_modules\ionic-app-lib\node_modules\cordova-lib\node_modules\cordova-js\node_modules\browserify
- shell-quote node_modules\ionic\node_modules\ionic-app-lib\node_modules\cordova-lib\node_modules\cordova-js\node_modules\browserify\node_modules\shell-quote
C:\Users\Richard\AppData\Roaming\npm
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.0.6 (node_modules\ionic\node_modules\ionic-app-lib\node_modules\webpack\node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic@2.0.0-beta.11"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.4.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.4.2 postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\Development\IDE\ionic-apps\theWhoZoo\npm-debug.log
npm ERR! code 1

更新

我发现我下载了Python,现在它似乎越走越远了。但我有一个错误,说我需要.NET Framework 2.0 SDK。当我从Microsoft下载exe时,它什么也没做。

任何想法如何安装.NET Framework 2.0 SDK

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 14/12/2016 19:20:16.
Project "C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\build\binding.sln" on node 1 (d
efault targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Mic
rosoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [C:\Users\Richard\AppData\Roam
ing\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\build\binding.sln]
Done Building Project "C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\build\binding.sln
" (default targets) -- FAILED.


Build FAILED.

"C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\build\binding.sln" (default target) (1)
 ->
(_src_\libsass target) ->
  MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install M
icrosoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [C:\Users\Richard\AppData\Ro
aming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\build\binding.sln]

    0 Warning(s)
    1 Error(s)

更新

感谢您的建议。我卸载并重新安装了NodeNpm。重新启动。已安装Cordova。试图安装Ionic,但有错误:

npm install -g ionic@2.0.0-beta.11

...
    15 Warning(s)
    257 Error(s)

    Time Elapsed 00:01:25.62
    gyp ERR! build error
    gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onExit (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\lib\build.js:276:23)
    gyp ERR! stack     at emitTwo (events.js:106:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
    gyp ERR! System Windows_NT 10.0.14393
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Richard\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules\\ionic-app-lib\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
    gyp ERR! cwd C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass
    gyp ERR! node -v v6.9.2
    gyp ERR! node-gyp -v v3.2.1
    gyp ERR! not ok
    Build failed
    [                ..] / postinstall: info lifecycle node-sass@3.4.2~postinstall: Failed to exec postinstall script

1 个答案:

答案 0 :(得分:1)

尝试此命令(以管理员身份打开cmd):

npm install --global --production windows-build-tools

这将安装所需的所有组件