npm ERR! No git binary found in $PATH - windows

I can't seem to get zenbot to install I am new to node.js, so please be kind. I am getting all kinds of error I do have git installed. I followed the install instructions and I really don't know where to start. I am a Java and C programming trying to cut my teeth on something new and learn through the bumps and bruises.
C:\zenbot>npm install
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\\AppData\Roaming\npm-cache\_logs\2017-12-25T08_17_27_513Z-debug.log
----- Log file--
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\nodejs\\node.exe',
1 verbose cli 'C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm#5.5.1
3 info using node#v8.9.3
4 verbose npm-session 5167d752483581f2
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall zenbot4#4.0.5
7 info lifecycle zenbot4#4.0.5~preinstall: zenbot4#4.0.5
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly fetchPackageMetaData error for forex.analytics#github:mkmarek/forex.analytics#7bc278987700d4204e959af17de61495941d1a14 No git binary found in $PATH
14 verbose stack Error: No git binary found in $PATH
14 verbose stack at checkGit (C:\nodejs\node_modules\npm\node_modules\pacote\lib\util\git.js:199:17)
14 verbose stack at spawnGit (C:\nodejs\node_modules\npm\node_modules\pacote\lib\util\git.js:178:10)
14 verbose stack at pinflight (C:\nodejs\node_modules\npm\node_modules\pacote\lib\util\git.js:110:12)
14 verbose stack at C:\nodejs\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
14 verbose stack at Promise._execute (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\debuggability.js:300:9)
14 verbose stack at Promise._resolveFromExecutor (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:483:18)
14 verbose stack at new Promise (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:79:10)
14 verbose stack at _inflight (C:\nodejs\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
14 verbose stack at C:\nodejs\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
14 verbose stack at tryCatcher (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
14 verbose stack at Promise._settlePromiseFromHandler (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
14 verbose stack at Promise._settlePromise (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
14 verbose stack at Promise._settlePromiseCtx (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:606:10)
14 verbose stack at Async._drainQueue (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:138:12)
14 verbose stack at Async._drainQueues (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
14 verbose stack at Immediate.Async.drainQueues (C:\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
15 verbose cwd C:\zenbot
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
18 verbose node v8.9.3
19 verbose npm v5.5.1
20 error code ENOGIT
21 error No git binary found in $PATH
22 error Failed using git.
22 error Please check if you have git installed and in your PATH.
23 verbose exit [ 1, true ]
C:\WINDOWS\system32>git -v Unknown option: -v usage: git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>] –

You are trying within C:\WINDOWS\system32, probably git executable is available over there.
Change the directory to C:\ and then try git --version.
If you get error git is not recognized..., then git path is not set in environment variables.
So, open your environment variable settings and set the git executable path to PATH variable.

Looks like it's missing from the alpine image.
npm install is kinda fundamental to node and git is required to install certain dependencies.
Including
RUN apk update && apk upgrade && \
apk add --no-cache git
in the dockerfile will fix it.

While running RUN npm install --progress=false --unsafe-perm in docker file on jenkins
FROM node:10.15.0-alpine (as the base image)
I was getting npm ERR! No git binary found in $PATH
Solution- added below line in docker file and it worked
RUN apk update && apk upgrade &&
apk add --no-cache git

Related

how to run Node-Red in docker using windows

I use this command in windows
I actually don't know where node_red_data is.
docker run -it -p 1882:1880 -v node_red_data:/data nodered/node-red
and I got following error.
npm ERR! code EJSONPARSE
npm ERR! file /usr/src/node-red/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /data/.npm/_logs/2021-01-26T11_44_30_912Z-debug.log
this is also my log file
this file is created automatically inside my node_red_data folder
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli '--no-update-notifier',
1 verbose cli '--no-fund',
1 verbose cli 'start',
1 verbose cli '--cache',
1 verbose cli '/data/.npm',
1 verbose cli '--',
1 verbose cli '--userDir',
1 verbose cli '/data' ]
2 info using npm#6.14.10
3 info using node#v10.23.1
4 verbose config Skipping project config: /usr/src/node-red/.npmrc. (matches userconfig)
5 verbose stack Error: Failed to parse json
5 verbose stack Unexpected end of JSON input while parsing near ''
5 verbose stack at parseError (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:470:11)
5 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:105:26)
5 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:52:5
5 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16
5 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
6 verbose cwd /usr/src/node-red
7 verbose Linux 4.19.128-microsoft-standard
8 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "--no-update-notifier" "--no-fund" "start" "--cache" "/data/.npm" "--" "--userDir" "/data"
9 verbose node v10.23.1
10 verbose npm v6.14.10
11 error code EJSONPARSE
12 error file /usr/src/node-red/package.json
13 error JSON.parse Failed to parse json
13 error JSON.parse Unexpected end of JSON input while parsing near ''
14 error JSON.parse Failed to parse package.json data.
14 error JSON.parse package.json must be actual JSON, not just JavaScript.
15 verbose exit [ 1, true ]
any help?
Hey the issue you are facing originates in mounting the volume (-v ...) you need to pass a valid Windows Path as an argument. For more information: Official Docker documentation
Command to run Node-RED as a Docker container: docker run -p 1880:1880 -it -v "<Path-on-your-Windows-OS>:/data" nodered/node-red
Where <Path-on-your-Windows-OS> e.g. C:\Users\<username>\Documents\node-red-docker
I just made my own node-red instance. I couldn't work with node-red image.
FROM node
WORKDIR /usr/src/node-red
RUN npm install -g --unsafe-perm node-red
CMD node-red

Received Z_BUF_ERROR while installing NativeScript

I just received Z_BUF_ERROR while installing NativeScript. I did Google but without any luck.
Environment:
Windows 10 Enterprise 1703 64-bit
NodeJS v6.11.2
npm v5.3.0
Command:
npm install -g nativescript
Error Log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Hui\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'nativescript' ]
2 info using npm#5.3.0
3 info using node#v6.11.2
4 verbose npm-session 4454628f9775be96
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/nativescript 1244ms
8 http fetch GET 200 https://registry.npmjs.org/nativescript/-/nativescript-3.1.3.tgz 23ms (from cache)
9 silly fetchPackageMetaData error for nativescript#latest unexpected end of file
10 verbose stack Error: unexpected end of file
10 verbose stack at Zlib._handle.onerror (zlib.js:370:17)
11 verbose cwd D:\Dev\Workspace\Local\Angular
12 verbose Windows_NT 10.0.15063
13 verbose argv "C:\Program Files\nodejs\node.exe" - "C:\Users\Hui\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "nativescript"
14 verbose node v6.11.2
15 verbose npm v5.3.0
16 error code Z_BUF_ERROR
17 error errno -5
18 error unexpected end of file
19 verbose exit [ -5, true ]
Any help would be appreciated.
try to clean cache by using this
npm cache clean --force

I'm trying to install all npm modules in ../AppData/Roaming folder. But each time it fails with error code - 4068

I'm simply using the following command: "npm install -g". OS: Windows 8.1, CMD is administrator. Error log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g' ]
2 info using npm#2.5.1
3 info using node#v0.12.1
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec { raw: '.',
7 silly cache add scope: null,
7 silly cache add name: null,
7 silly cache add rawSpec: '.',
7 silly cache add spec: 'C:\',
7 silly cache add type: 'local' }
8 error addLocal Could not install C:\
9 verbose stack Error: EISDIR, read
9 verbose stack at Error (native)
10 verbose cwd C:\
11 error Windows_NT 6.3.9600
12 error argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g"
13 error node v0.12.1
14 error npm v2.5.1
15 error code EISDIR
16 error errno -4068
17 error EISDIR, read
18 error If you need help, you may report this error at:
18 error http://github.com/npm/npm/issues
19 verbose exit [ -4068, true ]
It appears as though you are running npm install -g from your C: drive. npm has absolutely no idea what you want it to install unless you:
pass it arguments, like how npm install -g npm will globally install npm
run it in a directory that contains a package
Since you are not passing the command any arguments, npm assumes you want it to install what is in your current working directory. Since you do not have a package at the root of your C: drive, npm correctly errors out with the EISDIR error ("error: is directory").

Issue in starting Node App on Windows 7

I am using windows 7 and I have installed node.js and express.
After I create a project using express using the command below
> express projectName
A new project is created and after that to install dependencies I do
> npm install
All works good so far. but when I try to start the application
> npm start
Below is the issue I get in the npm-debug.log file. Please suggest whats wrong here. I have tried many other threads but solution found there work for me.
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#1.4.28
3 info using node#v0.10.33
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart NodeTestApp#0.0.0
7 info start NodeTestApp#0.0.0
8 verbose unsafe-perm in lifecycle true
9 info NodeTestApp#0.0.0 Failed to exec start script
10 error NodeTestApp#0.0.0 start: `node ./bin/www`
10 error spawn ENOENT
11 error Failed at the NodeTestApp#0.0.0 start script.
11 error This is most likely a problem with the NodeTestApp package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error node ./bin/www
11 error You can get their info via:
11 error npm owner ls NodeTestApp
11 error There is likely additional logging output above.
12 error System Windows_NT 6.1.7601
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error cwd C:\Users\Ali\Desktop\NodeTestApp
15 error node -v v0.10.33
16 error npm -v 1.4.28
17 error syscall spawn
18 error code ELIFECYCLE
19 error errno ENOENT
20 verbose exit [ 1, true ]
child_process.spawn() returns ENOENT when it can't find the requested executable; in this case, node.exe. Looking closely at the log, we can see that npm start is attempting to run node app.js.
Is node on your PATH? What happens if you just type node app.js on the command line?
Try this.It's working for me on Windows 7 32 bit node.js
Create new blank folder for your project.Go to your project folder and create manually npm folder (don't use command line).
Then try again create new project.
Hope this help.

"npm faq" fails on Windows 7 ("spawn ENOENT" errors)

I have installed node.js on Windows 7 with their latest installer. It seemed to work, I can call npm and node from the console (either cmd or PowerShell), but I keep getting errors.
There are a lot of questions here about node.js on windows, but they all mention some specific piece of code. I'm getting the "spawn ENOENT" with a lot of simple commands, for instance yo, if I then pick "update generators" :
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
even npm faq fails :
PS E:\www\something> npm faq
npm ERR! Error: spawn ENOENT
npm ERR! at errnoException (child_process.js:988:11)
npm ERR! at Process.ChildProcess._handle.onexit (child_process.js:779:34)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/isaacs/npm/issues>
It seems that the problem is that node uses unix command names like dir, which do not exist on Windows. Some blog posts mention using Cygwin, but mostly for building node.js, not for calling it. The official nodejs website doesn't mention that cygwin is a prerequisite, either.
Here's the npm-debug.log :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'faq' ]
2 info using npm#1.3.24
3 info using node#v0.10.25
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 error Error: spawn ENOENT
5 error at errnoException (child_process.js:988:11)
5 error at Process.ChildProcess._handle.onexit (child_process.js:779:34)
6 error If you need help, you may report this *entire* log,
6 error including the npm and node versions, at:
6 error <http://github.com/isaacs/npm/issues>
7 error System Windows_NT 6.1.7601
8 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "faq"
9 error cwd E:\
10 error node -v v0.10.25
11 error npm -v 1.3.24
12 error syscall spawn
13 error code ENOENT
14 error errno ENOENT
15 verbose exit [ 1, true ]
Make sure that you have c:\Windows\System32 on your 'Path' System Variable. I was having this exact problem and this was the fix I needed. I must have taken it out in error sometime in the past.

Resources