简体   繁体   English

无法在Windows上安装Ionic

[英]Unable to Install Ionic on Windows

I'm meant to be maintaining an Ionic app, but I cannot install Ionic on any of my machines (neither at work - Win 7) nor at home (Win 10). 我本打算维护Ionic应用程序,但无法在任何机器上(无论是在工作中-Win 7)还是在家里(Win 10)都无法安装Ionic。

Perhaps we could start with my home machine (Win 10). 也许我们可以从我的家用计算机开始(Win 10)。 After the fail, I uninstalled Node completely, and restarted the machine. 失败后,我完全卸载了Node,然后重新启动了计算机。 I re-installed Nodejs and upgraded npm such that the versions are: Nodejs: 10.4.1 NPM: 6.1.0 我重新安装了Nodejs,并升级了npm,以使这些版本为:Nodejs:10.4.1 NPM:6.1.0

The output from my Powershell prompt (at elevated privileges) is: 我的Powershell提示符(特权提升)的输出是:

PS F:\\Code\\Powershell\\Toolkit> npm install -g ionic npm ERR! PS F:\\ Code \\ Powershell \\ Toolkit> npm install -g ionic npm错误! path C:\\Users\\roger\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules.readable-stream.DELETE npm ERR! 路径C:\\ Users \\ roger \\ AppData \\ Roaming \\ npm \\ node_modules \\ ionic \\ node_modules.read-stream.DELETE npm ERR! code ENOTEMPTY npm ERR! 代码ENOTEMPTY npm ERR! errno -4051 npm ERR! errno -4051 npm错误! syscall rmdir npm ERR! syscall rmdir npm错误! ENOTEMPTY: directory not empty, rmdir 'C:\\Users\\roger\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules.readable-stream.DELETE' ENOTEMPTY:目录不为空,rmdir'C:\\ Users \\ roger \\ AppData \\ Roaming \\ npm \\ node_modules \\ ionic \\ node_modules。可读流.DELETE'

npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! 可以在以下位置找到该运行的完整日志:npm ERR! C:\\Users\\roger\\AppData\\Roaming\\npm-cache_logs\\2018-06-17T01_32_39_358Z-debug.log C:\\ Users \\用户罗杰\\应用程序数据\\漫游\\ NPM-cache_logs \\ 2018-06-17T01_32_39_358Z-的debug.log

Interestingly, the directory .readable-stream.DELETE referred to as being not empty, is empty. 有趣的是,称为.readable-stream.DELETE的目录不为空。 So, not sure what is going on there. 因此,不确定那里发生了什么。

Any help would be great. 任何帮助都会很棒。 Thanks 谢谢

First thing to do is sort out that directory deletion issue. 首先要做的是解决目录删除问题。 Make sure you uninstall Nodejs to make sure none of its processes are locking that directory. 确保卸载Node.js,以确保其所有进程均未锁定该目录。

Try the following. 尝试以下方法。

  1. Right-click the drive upon which that directory is located (probably C drive). 右键单击该目录所在的驱动器(可能是C驱动器)。
  2. Click Properties on the Context Menu 在上下文菜单上单击属性
  3. Go to the Tools tab 转到工具标签
  4. Click the Check button. 单击Check按钮。

Let it run its course. 让它顺其自然。 Once complete, if all looks well, try deleting the directory again. 完成后,如果一切正常,请尝试再次删除目录。

If that succeeded, install Node again (v8.11.3). 如果成功,请再次安装Node(v8.11.3)。 Don't upgrade NPM. 不要升级NPM。
Install Ionic again with npm install -g ionic 使用npm install -g ionic再次安装Ionic
Create an app ionic start myApp tabs 创建一个应用程序ionic start myApp tabs
Change to the myApp directory. 转到myApp目录。
Run ionic serve 运行ionic serve

Hopefully the first part will clear away that folder and get you on your way. 希望第一部分将清除该文件夹并带您上路。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM