【新手】ionic搭建工程无法执行npm install

季末晚风 2018-09-28 02:42:24
1. 本人完全按照ionic官网提供的方式安装了ionic的运行环境。
node@10.9.0
cordova@8.1.1
ionic@3.10.3 --因为最新的无法执行ionic start myApp 被我降了版本。
同时因为各种百度,还安装了:
python@2.7.3
.net.freemark.2.0 sdk
Microsoft Visual Studio 2013

2. 现在能够安全执行ionic start myApp,但是在npm install时出现:
> node-sass@4.5.3 install C:\Users\admin\Desktop\cordova\app1\node_modules\@ionic\app-scripts\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-64_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-64_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

> node-sass@4.9.3 install C:\Users\admin\Desktop\cordova\app1\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\admin\AppData\Roaming\npm-cache\node-sass\4.9.3\win32-x64-64_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\admin\Desktop\cordova\app1\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.5.3 postinstall C:\Users\admin\Desktop\cordova\app1\node_modules\@ionic\app-scripts\node_modules\node-sass
> node scripts/build.js

之后build时出现错误:
......
C:\Users\admin\.node-gyp\10.9.0\include\node\node_buffer.h(34): error C2440: “初始化”: 无法从“unknown”转换为“const unsigned int” (..\src\sass_types\number.cpp) [C:\Users\admin\Desktop\cordova\app1\node_modules\
@ionic\app-scr
ipts\node_modules\node-sass\build\binding.vcxproj]
C:\Users\admin\.node-gyp\10.9.0\include\node\node_buffer.h(34): error C2597: 对非静态成员“v8::TypedArray::kMaxLength”的非法引用 (..\src\sass_types\string.cpp) [C:\Users\admin\Desktop\cordova\app1\node_modules\@ioni
c\app-script
s\node_modules\node-sass\build\binding.vcxproj]
C:\Users\admin\.node-gyp\10.9.0\include\node\node_buffer.h(34): error C2440: “初始化”: 无法从“unknown”转换为“const unsigned int” (..\src\sass_types\string.cpp) [C:\Users\admin\Desktop\cordova\app1\node_modules\
@ionic\app-scr
ipts\node_modules\node-sass\build\binding.vcxproj]

11 个警告
140 个错误
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\admin\Desktop\cordova\app1\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\admin\\Desktop\\cordova\\app1\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\admin\Desktop\cordova\app1\node_modules\@ionic\app-scripts\node_modules\node-sass
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.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"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-09-28T06_32_15_004Z-debug.log


查看附图。



...全文
174 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

80,471

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧