Angular-cli未能正确安装

我想知道你能否帮助我

我试图通过npm命令来安装angular-cli

npm install -g angular-cli,但是我得到了很多消息,'ng'命令不起作用。

我得到的一些错误如下

> node-zopfli@1.4.0 install C:\Users\my name\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli 

节点pre-gyp安装 – 回落到构build

node-pre-gyp ERR! 试过下载: https : //node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.gz node-pre-gyp ERR! 未find针对node-zopfli@1.4.0和node@6.5.0(node-v48 ABI)的预构build二进制文件(使用node-gyp回退到源代码编译)gyp ERR! configuration错误gyp ERR! 堆栈错误:找不到Python可执行文件“python”,可以设置PYTHON envvariables。 gyp ERR! 在failNoPython(C:\ Users \我的名字\ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-gyp \ lib \ configure.js:449:14) 在C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-gyp \ lib \ configure.js:404:11 gyp ERR! 堆栈在FSReqWrap.oncomplete(fs.js:123:15)gyp ERR! 系统Windows_NT 10.0.14393 gyp ERR! 命令“C:\ Program Files \ nodejs \ node.exe”“C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-gyp \ bin \ node-gyp.js”“ “-module = C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-zopfli \ lib \ binding \ node-v48- win32-x64 \ zopfli.node“–module_name = zopfli”“–module_path = C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-zopfli \ lib \ binding \节点-v48-win32-x64“gyp ERR! cwd C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-zopfli gyp ERR! node -v v6.5.0 gyp ERR! node-gyp -v v3.4.0 gyp ERR! 不正确node-pre-gyp ERR! 构build错误node-pre-gyp ERR! 堆栈错误:无法执行'C:\ Program Files \ nodejs \ node.exe C:\ Users \我的名字\ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-gyp \ bin \ node-gyp。 js configure -fallback-to-build –module = C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-zopfli \ lib \ binding \ node-v48-win32-x64 \ zopfli.node –module_name = zopfli –module_path = C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-zopfli \ lib \ binding \ node-v48-win32-x64 '(1)node-pre-gyp ERR! 堆栈在ChildProcess。 (C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-pre-gyp \ lib \ util \ compile.js:83:29)node-pre-gyp ERR! 在emitTwo堆栈(events.js:106:13)node-pre-gyp ERR! 堆栈在ChildProcess.emit(events.js:191:7)node-pre-gyp ERR! stack at maybeClose(internal / child_process.js:877:16)node-pre-gyp ERR! 堆栈在Process.ChildProcess._handle.onexit(internal / child_process.js:226:5)node-pre-gyp ERR! 系统Windows_NT 10.0.14393 node-pre-gyp ERR! 命令“C:\ Program Files \ nodejs \ node.exe”“C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-pre-gyp \ bin \ node-pre-gyp “”install“” – fallback-to-build“node-pre-gyp ERR! cwd C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-zopfli node-pre-gyp ERR! node -v v6.5.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.30 node-pre-gyp ERR! 不正确无法执行'C:\ Program Files \ nodejs \ node.exe C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-gyp \ bin \ node-gyp.jsconfiguration – 下降到生成 – 模块= C:\用户\我的名字\应用程序数据\漫游\ npm \ node_modules \angular度cli \ node_modules \节点zopfli \ lib \绑定\节点v48-win32-x64 \ zopfli.node –module_name = zopfli –module_path = C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-zopfli \ lib \ binding \ node-v48-win32-x64' (1)npm WARN安装:node-zopfli@1.4.0 node-zopfli@1.4.0安装: node-pre-gyp install --fallback-to-build gyp安装node-pre-gyp install --fallback-to-build npm WARN安装:node-zopfli@1.4.0退出状态1

node-sass@3.10.0安装C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-sass节点脚本/ install.js

开始下载二进制文件https://github.com/sass/node-sass/releases/download/v3.10.0/win32-x64-48_binding.node二进制下载并安装在C:\ Users \ my name \ AppData \ Roaming \ NPM \ node_modules \angularCLI \ node_modules \节点萨斯\厂商\ Win32的x64-48 \ binding.node

node-sass@3.10.0 postinstall C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-sass节点脚本/ build.js

我需要安装node.js以外的其他东西吗?

我对Angular来说是一个相当新的东西,试图做一些教程和实验

感谢您的帮助和时间

我不是在Windows上,但是你应该首先考虑做什么,使用pipe理权限运行命令行。 在二级菜单上select应用程序(右键单击)select作为pipe理员运行。

在此之前确保你已经安装了最新版本的node.js。 并运行以下命令。

npm uninstall -g angular/cli npm cache clean npm install -g angular/cli@latest

这个更新。 我安装了新的node.js V6.6.0,卸载了Angular-Cli,清理caching并重新安装了Clie,似乎已经成功了,因为这次我能够安装Angular-CLI而没有任何问题,ng新的工作。

设置环境variablesPYTHON ,其中安装了python.exe的完整path的值。 如果它的C:\Program Files\Python34\ then的值是C:\Program Files\Python34\python.exe