3

I wonder if you can help me.

I tried to install the angular-cli by the npm command

npm install -g angular-cli, however I got a lot of messages, and 'ng' command does not work.

Some of the errors I got are as following

> [email protected] 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! Tried to download: https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (C:\Users\my name\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-gyp\lib\configure.js:449:14) gyp ERR! stack at C:\Users\my name\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-gyp\lib\configure.js:404:11 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15) gyp ERR! System Windows_NT 10.0.14393 gyp ERR! command "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" 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! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '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' (1) node-pre-gyp ERR! stack at 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! stack at emitTwo (events.js:106:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) node-pre-gyp ERR! System Windows_NT 10.0.14393 node-pre-gyp ERR! command "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! not ok Failed to execute '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' (1) npm WARN install:[email protected] [email protected] install: node-pre-gyp install --fallback-to-build npm WARN install:[email protected] Exit status 1

[email protected] install C:\Users\my name\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass node scripts/install.js

Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.10.0/win32-x64-48_binding.node Binary downloaded and installed at C:\Users\my name\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass\vendor\win32-x64-48\binding.node

[email protected] postinstall C:\Users\my name\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass node scripts/build.js

Do I need to install anything other then node.js?

Im quite new to Angular, trying to do some tutorials and experiments

Thanks for your help and time

2
  • What is your OS and what is your node and npm version ? Commented Sep 17, 2016 at 13:19
  • I've just posted a possible solution: stackoverflow.com/a/69642595/6306909 Commented Oct 20, 2021 at 8:25

3 Answers 3

1

set environment variable PYTHON, with value of full path where python.exe is installed. If its C:\Program Files\Python34\ then value will be C:\Program Files\Python34\python.exe

Sign up to request clarification or add additional context in comments.

Comments

1

I am not on Windows but what you should consider doing first, run command line with administrative privileges. select the application on secondary menu (right click) select runs as admin.

Before that make sure you have installed the latest version of node.js. and the run the following commands.

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

8 Comments

I tried that but I am still getting the same errors. It does install an angular-cli in my Roaming/npm/node_modules but when I try ng --help, its telling me that 'ng' is not recognized as an internal or external command,
I was thinking of running Linux on Hyper-V, do you think its worth the hassle? Would it run smoother maybe?
installed a VM and angular cli running there now.
For your first question you can fix it as explained here. stackoverflow.com/questions/37991556/…
It would run better but with windows you just need to set up everything right. But if you move to linux the better.
|
0

An update on this. I installed the new node.js V6.6.0, uninstalled the Angular-Cli, cleaned cache and re-installed the clie and it seems to have done the trick since I was able to install the Angular-CLI without problems this time, and ng new is working.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.