Ionic 2安装问题 [英] Ionic 2 installation issues
问题描述
我正在尝试在Windows 7 x64位上使用Ionic 2并在使用ionic start命令时卡住了。我试过阅读教程和安装说明,但没有运气。以下是我的问题的详细信息:
I am trying to use Ionic 2 on Windows 7 x64 bit and got stuck when using ionic start command. I have tried to read tutorials and installation instructions but got no luck. Here's the details of my problem:
- 在科尔多瓦和离子安装期间发现折旧警告:
https://postimg.org/image/vf3qn8z9b/
-
然后它在离子中使用以下命令显示错误:
Then it shows errors using following command in ionic:
离子启动newProject sidemenu --v2
ionic start newProject sidemenu --v2
https://postimg.org/image/4vz80prq5/
我的背景npm-debug.log:
context of my npm-debug.log:
9284 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
69285 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: ia32
69287 verbose stack Error: node-sass@3.10.1 postinstall: `node scripts/build.js`
69287 verbose stack Exit status 1
69287 verbose stack at EventEmitter.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
69287 verbose stack at emitTwo (events.js:106:13)
69287 verbose stack at EventEmitter.emit (events.js:191:7)
69287 verbose stack at ChildProcess.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
69287 verbose stack at emitTwo (events.js:106:13)
69287 verbose stack at ChildProcess.emit (events.js:191:7)
69287 verbose stack at maybeClose (internal/child_process.js:885:16)
69287 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
69288 verbose pkgid node-sass@3.10.1
69289 verbose cwd C:\Users\Lime\newIonicProj
69290 error Windows_NT 6.1.7601
69291 error argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
69292 error node v7.3.0
69293 error npm v3.10.10
69294 error code ELIFECYCLE
69295 error node-sass@3.10.1 postinstall: `node scripts/build.js`
69295 error Exit status 1
69296 error Failed at the node-sass@3.10.1 postinstall script 'node scripts/build.js'.
69296 error Make sure you have the latest version of node.js and npm installed.
69296 error If you do, this is most likely a problem with the node-sass package,
69296 error not with npm itself.
69296 error Tell the author that this fails on your system:
69296 error node scripts/build.js
69296 error You can get information on how to open an issue for this project with:
69296 error npm bugs node-sass
69296 error Or if that isn't available, you can get their info via:
69296 error npm owner ls node-sass
69296 error There is likely additional logging output above.
69297 verbose exit [ 1, true ]
应用解决方案:
- 已安装的nodejs 7.3.0(截至目前的当前版本)。
注意:我曾尝试安装x64位,但由于我遇到错误,所以我切换到x86版本但仍然没有运气。我也尝试将nodejs降级到6.9.2和v4.4.7,但没有取得任何进展。
Note: I have tried to install x64 bit but since I got errors, so I switched to x86 version and still no luck. I have also tried to downgrade nodejs to 6.9.2 and v4.4.7 but have made no progress at all.
-
使用npm install -g npm升级npm,清除缓存并更新注册表
Upgraded npm using "npm install -g npm", clear cache and update registry
尝试重建node-sass
Tried to rebuild node-sass
尝试手动安装minimatch,uuid和fsevents
Tried to install minimatch, uuid and fsevents manually
任何想法,我在安装过程中错过了什么?在使用离子版本1创建项目时遇到了同样的问题。
Any idea, what I missed during the installation? I got same problems when creating projects using ionic version 1.
推荐答案
在一系列卸载和安装所有依赖项后,我发现了由于node-sass与当前版本的nodejs不兼容而导致问题发生。我通过以下方式解决了这个问题:
After series of uninstalling and installing the all dependencies, I found out that the problem occurred because of the incompatibility of node-sass to the current version of nodejs. I have solved the problem by:
- 安装x86 nodejs版本7.3.0
- 安装cordova和离子(非beta)
- 更新了node-sassinstall -g node-sass
- 使用命令npm再次构建node-sass rebuild node-sass
- installing x86 nodejs version 7.3.0
- install cordova and ionic (not beta)
- updated node-sass "install -g node-sass"
- built node-sass again by using the command "npm rebuild node-sass"
之后,当我尝试运行ionic serve命令时,发生了错误。错误消息是:
After that, the when I tried to run "ionic serve" command, an error occurred. The error message was:
离子服务错误:错误:ENOENT:没有这样的文件或目录,打开
'/ home /.../ IonicTest / www / index.html'
"Ionic serve error: Error: ENOENT: no such file or directory, open '/home/.../IonicTest/www/index.html'"
- run命令npm run build参考:
- run the command "npm run build" reference:
欢呼!它已经在工作:D
And cheers! It's already working :D
这篇关于Ionic 2安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!