Python error in mern installation - node.js

I am php developer and now i want to build project with mern.io. and getting some errors in command line, can anyone help me to get out of these or let me know why these errors are showing up. I installed node.js,git and python.
I wrote the following commands.
npm install -g mern-cli
mern init your_new_app
cd your_new_app
npm install
Following errors are showing in cmd.
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\JAVED\AppData\Local\Programs\Python\Python36-32\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\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.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\mern\node_modules\nodejieba
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

I guess your system lacks the python, Kindly install python dependecy and then try to install the same. You may refer python installation procedure # https://www.howtogeek.com/197947/how-to-install-python-on-windows/

What version of python do you have? I'm running into the exact same error and after some googling I found this https://github.com/nodejs/node-gyp/issues/1337
It seems node-gyp doesn't support python 3. Unfortunately after reading through the entire thread, I couldn't find a solution other than downgrading to python 2.7

Related

I'm setting up an ionic project and getting these errors when run the command npm install

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:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:149:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-lifecycle\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\test-proj\Angular\ionic-test\node_modules\ed25519
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Your problem is about python, not node or angular. There are a lot of questions about python path problem like:
npm - "Can't find Python executable "python", you can set the PYTHON env variable."
https://github.com/iost-official/explorer/issues/1
https://hisk.io/how-to-fix-node-js-gyp-err-cant-find-python-executable-python-on-windows/
I installed windows build tools and it solved my problem.

node-sspi installation error with node V12

Im trying to install node-sspi, but im 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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:165:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
Is there any solution to fix the error or is there any alternative package.
This package does not have binaries for Node.js 12. See open issue https://github.com/abbr/NodeSSPI/issues/69. You can either downgrade Node.js version or try to compile binaries. See Installation instructions https://github.com/abbr/NodeSSPI#installation

Unable to install tensorflow.js

I am trying to install tensorflow.js on a windows machine using:
npm install #tensorflow/tfjs-node-gpu
I am using python 2.7 and have tried updating npm.
Whenever I do that I get the following error:
Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Coding\AI\node_modules\#tensorflow\tfjs-node-gpu
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
I ran into the same problem on Mac. This issue on github points out that when you use this package node-gyp (which I think is a cross-platform tool used to help install Tensorflow), you need to make sure that your file path doesn't contain any spaces.
So, based on your error message, it looks like you are trying to install tensorflow in a project that is in the Program Files\ folder. node-gyp doesn't like that because you have spaces in the name. It's kind of annoying, but I fixed the problem by putting my node project in a folder without spaces, i.e. /Users/Bryce/Coding-Projects/MyProject/
This worked for me:
npm install #tensorflow/tfjs
You update npm package first:
npm update
And upgrade:
npm upgrade

Node Js gyph errors

Im trying to install this module with NPM install:
https://www.npmjs.com/package/node-adwords-es5
Somehow im getting a bunch of errors in git bash. See them here below:
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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\kevin\Desktop\adwordsapi\node_modules\ursa
gyp ERR! node -v v6.10.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
It did install my package tho. Are those errors crucial for further development? I'm just starting out with nodeJS. I hope you can help me, if this has any issues for further development id like to know how to solve this.
Thanks in advance
Since I can't comment :(
It's a known issue with node-gyp.
Try following the thread here
Also check the answer here

NodeJS 5 errors while installing npm packages

Since I installed node 5.0.0, I start getting errors while installing most of npm packages.
it never happened before when I had node 4.x.
after
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python27\python.exe", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Murhaf\AppData\Roaming\npm\node_modules\ember-cli\node_modules\bufferutil
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10240
basically there's 2 main errors.
The first is asking for python.
The second is asking for .Net SDK 2.0.
after getting python 2.7.10 installed the first error disappeared. but I couldn't pass the MSbuild.exe error even after installing .Net SDK.
Is this happening with everyone?
Do I have to install Visual Studio to get node.js and NPM to work?
I prefer not to. Any alternative way?
I tried a clean installation, restarted my PC and installed it again, same errors.
Update
Now I installed both Python and VS2015, the previous errors are gone but I have this error
c:\Users\Murhaf\Desktop\sage\node_modules\bufferutil\build\bufferutil.vcxproj(20,3): error MSB4019: The imported projec
t "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the
path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Users\Murhaf\Desktop\sage\node_modules\bufferutil
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:bufferutil bufferutil#1.2.1 install: `node-gyp rebuild`
npm WARN install:bufferutil Exit status 1
you need Visual Studio and Python to install modules with binary components on windows, which probably means the module you are trying to install has binary components, so try to install it after Visual studio and Python.
npm install --msvs_version=2013 should work.
I am having problems with VS2015, too.

Resources