我想知道你是否可以帮助我。
我尝试通过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
node-pre-gyp install --fallback-to-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!找不到node-zopfli@1.4.0和node@6.5.0(node-v48 ABI)的预构建二进制文件(使用node-gyp回退到源代码编译)
gyp ERR!配置错误
gyp ERR!堆栈错误:无法找到Python可执行文件" python",您可以设置PYTHON env变量。
gyp ERR!在failNoPython堆栈(C:\ Users \ my name \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-gyp \ lib \ configure.js:449:14)
gyp ERR!堆栈在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&# 34; " - 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"
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!构建错误
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.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的64' (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!在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" "安装" " - 后退到构建"
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。 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& #39; (1)
npm WARN安装:node-zopfli@1.4.0 node-zopfli@1.4.0安装: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 node scripts / 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 \ angular-cli \ node_modules \ node-sass \ vendor \ 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 node scripts / build.js
我是否需要安装除node.js以外的任何其他内容?
我是Angular的新手,尝试做一些教程和实验
感谢您的帮助和时间
答案 0 :(得分:1)
我不在Windows上但你应该考虑先做什么,运行具有管理权限的命令行。在二级菜单上选择应用程序(右键单击)选择以管理员身份运行。
在此之前,请确保已安装最新版本的node.js.并运行以下命令。
npm uninstall -g angular/cli
npm cache clean
npm install -g angular/cli@latest
答案 1 :(得分:0)
对此进行更新。我安装了新的node.js V6.6.0,卸载了Angular-Cli,清理了缓存并重新安装了clie,它似乎已经完成了这个技巧,因为我这次能够安装Angular-CLI而没有问题,并且ng新工作正在进行中。
答案 2 :(得分:0)
设置环境变量PYTHON
,其中包含安装python.exe
的完整路径的值。
如果其C:\Program Files\Python34\
则值为C:\Program Files\Python34\python.exe