0

I have been trying to install loopback nodejs framework on windows using the command npm install -g loopback-cli. However, i am getting the following error

> 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 PythonFinder.failNoPython
> (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:483:19)
> gyp ERR! stack     at PythonFinder.<anonymous>
> (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:508:16)
> gyp ERR! stack     at
> C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
> gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21) gyp ERR!
> System Windows_NT 10.0.16299 gyp ERR! command "C:\\Program
> Files\\nodejs\\node.exe"
> "C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npm-lifecycle\\node_modules\\node-gyp\\bin\\node-gyp.js"
> "rebuild" gyp ERR! cwd
> C:\Users\HP\AppData\Roaming\npm\node_modules\loopback-cli\node_modules\ursa
> gyp ERR! node -v v8.11.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4
> (node_modules\loopback-cli\node_modules\ursa): npm WARN optional
> SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 install: `node-gyp rebuild`
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
M.A.G
  • 559
  • 2
  • 6
  • 21
  • Gyp requires Python, it's telling you that. Do you have Python installed? – Sam H. Mar 31 '18 at 18:18
  • @SamH. i do not know. What am i supposed to do to install it or check if it is present – M.A.G Mar 31 '18 at 18:22
  • It you type python into the command line and got enter, does it open a Python REPL or throw an error? – Sam H. Mar 31 '18 at 18:23
  • @SamH. it throws an error that the term python is not recognized – M.A.G Mar 31 '18 at 18:30
  • Hopefully it is now clear that this is the problem. This answer has the steps you should follow https://stackoverflow.com/a/39648550/3518108 – Sam H. Mar 31 '18 at 18:35

1 Answers1

2

You need Python 2.7.x for this to work on your machine. Your windows machine is missing essential build tools.

Install windows build tools from npm.

npm install --global --production windows-build-tools