publishing angular 6 application in github pages - node.js

I have been battling with getting my application up and running in github pages.
i have a hosted repo which i used for testing purpose and i have follow all the steps needed to get the application up and running but all effort avail abortive
git init
git add READMe.md
git commit -m "first commit"
git remote add origin repo url
git push origin master
npm i -g angular-cli-ghpages
ng build --prod --base-href https://username.github.io/repo/
ngh
after this point i am getting the below errors
An error occurred!
Error: Unspecified error (run without silent option for detail)
at C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\index.js:232:19
at _rejected (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:844:24)
at C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:870:30
at Promise.when (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:1122:31)
at Promise.promise.promiseDispatch (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:788:41)
at C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:604:44
at runSingle (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:137:13)
at flush (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:150:11)
i have also tried all possible suggestions online but none worked for me... pls i need help in what i am doing wrong.
update as requested
C:\Users\TOSHIBA\Desktop\Angular\application>ngh --no-silent
Cloning https://github.com/Nazehs/application.git into ......\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages.cache
An error occurred!
{ ProcessError: Cloning into '......\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages.cache'...
fatal: unable to access 'https://github.com/Nazehs/application.git/': Couldn't resolve host 'github.com'
at ChildProcess.<anonymous> (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\git.js:47:23)
at ChildProcess.emit (events.js:160:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
code: 128,
message: 'Cloning into \'..\..\..\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\.cache\'...\nfatal: unable to access \'https://github.com/Nazehs/application.git/\': Couldn\'t resolve host \'github.com\'\n',
name: 'ProcessError' }
new output of the result
Cleaning
Fetching origin
Checking out origin/gh-pages
Removing files
Copying files
Adding all
An error occurred!
{ ProcessError: warning: LF will be replaced by CRLF in 3rdpartylicenses.txt.
The file will have its original line endings in your working directory.
error: open("karma.conf.js"): Permission denied
error: unable to index file karma.conf.js
fatal: adding files failed
at ChildProcess.<anonymous> (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\git.js:47:23)
at ChildProcess.emit (events.js:160:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
code: 128,
message: 'warning: LF will be replaced by CRLF in 3rdpartylicenses.txt.\nThe file will have its original line endings in your working directory.\nerror: open("karma.conf.js"): Permission denied\nerror: unable to index file karma.conf.js\nfatal: adding files failed\n',
name: 'ProcessError' }
new error
Pushing
An error occurred!
{ ProcessError: fatal: HttpRequestException encountered.
An error occurred while sending the request.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
at ChildProcess.<anonymous> (C:\Users\nazehab\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\git.js:47:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
code: 128,
message:
'fatal: HttpRequestException encountered.\n An error occurred while sending the request.\r\nbash: /dev/tty: No such device or address\nerror: failed to execute prompt script (exit code 1)\nfatal: could not read Username for \'https://github.com\': No error\n',
name: 'ProcessError' }

The error is because of incorrect proxy settings.
So, if you have proxy you have to add it to the git config or environment variables.
set HTTPS_PROXY=http://<login>:<password>#proxy:port
set HTTP_PROXY=http://<login>:<password>#proxy:port
set NO_PROXY=localhost,my.company
Note the NO_PROXY, to allow to access internal site to your company
You also can register that in your git config:
git config --global http.proxy http://<login>:<password>#proxy:port
OR, if you don't have proxy you can try to unset the proxy settings
git config --global --unset http.proxy
https version:
git config --global --unset https.proxy

Related

ERR_ELECTRON_BUILDER_CANNOT_EXECUTE - package.json: The data present in the reparse point buffer is invalid

I'm using NodeJS 10 and Electron 10 (both of which are quite old). I'm trying to install a local custom module, which I'm including using the answer at How to specify local modules as npm package dependencies. But when I then run
npm install
I see the following error
⨯ open C:\Development\my-project\node_modules\my-custom-module\package.json: The data present in the reparse point buffer is invalid.
github.com/develar/app-builder/pkg/node-modules.(*Collector).resolveDependency
/Volumes/data/Documents/app-builder/pkg/node-modules/nodeModuleCollector.go:192
github.com/develar/app-builder/pkg/node-modules.(*Collector).processDependencies
/Volumes/data/Documents/app-builder/pkg/node-modules/nodeModuleCollector.go:95
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
/Volumes/data/Documents/app-builder/pkg/node-modules/nodeModuleCollector.go:56
github.com/develar/app-builder/pkg/node-modules.ConfigureCommand.func1
/Volumes/data/Documents/app-builder/pkg/node-modules/tree.go:41
github.com/alecthomas/kingpin.(*actionMixin).applyActions
/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin#v2.2.6+incompatible/actions.go:28
github.com/alecthomas/kingpin.(*Application).applyActions
/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin#v2.2.6+incompatible/app.go:557
github.com/alecthomas/kingpin.(*Application).execute
/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin#v2.2.6+incompatible/app.go:390
github.com/alecthomas/kingpin.(*Application).Parse
/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin#v2.2.6+incompatible/app.go:222
main.main
/Volumes/data/Documents/app-builder/main.go:90
runtime.main
/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/proc.go:203
runtime.goexit
/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/asm_amd64.s:1373
⨯ C:\Development\my-project\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE stackTrace=
Error: C:\Development\my-project\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
at ChildProcess.childProcess.once.code (C:\Development\my-project\node_modules\builder-util\src\util.ts:243:14)
at Object.onceWrapper (events.js:286:20)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
Any ideas on what could cause this problem? The error message itself seems to pop up in relation to OneDrive.

Why I got unable to get local issuer certificate for https://registry.yarnpkg.com

I just happen to get error unable to get local issuer certificate when running yarn add <anything>.
Yesterday it worked fine, but today it happens out of nowhere, I can't remember doing anything specifically.
After running yarn config set strict-ssl false it becomes working again, but that is very suspicious.
I know my question seems duplicate, but it doesn't. I have been searching everywhere but they seems to be for some cases such as running behind a corporate proxy or doing a new server set up. I am not behind any proxy.
Could you please help me see where should I investigate further to know the real root cause.
I am on macOS Monterey 12.0.1
Full Log
z:~/work/littlepawcraft/mawsay[main !?]$ yarn add html2canvas --verbose
yarn add v1.22.19
verbose 0.185927225 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.npmrc".
verbose 0.186249071 Checking for configuration file "/Users/z/.npmrc".
verbose 0.186511794 Found configuration file "/Users/z/.npmrc".
verbose 0.187669087 Checking for configuration file "/usr/local/etc/npmrc".
verbose 0.188048555 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.npmrc".
verbose 0.188284222 Checking for configuration file "/Users/z/work/littlepawcraft/.npmrc".
verbose 0.188639829 Checking for configuration file "/Users/z/work/.npmrc".
verbose 0.188928153 Checking for configuration file "/Users/z/.npmrc".
verbose 0.189152548 Found configuration file "/Users/z/.npmrc".
verbose 0.189640273 Checking for configuration file "/Users/.npmrc".
verbose 0.191425842 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.yarnrc".
verbose 0.191663753 Checking for configuration file "/Users/z/.yarnrc".
verbose 0.191811016 Found configuration file "/Users/z/.yarnrc".
verbose 0.192157101 Checking for configuration file "/usr/local/etc/yarnrc".
verbose 0.192324062 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.yarnrc".
verbose 0.192446487 Checking for configuration file "/Users/z/work/littlepawcraft/.yarnrc".
verbose 0.192626013 Checking for configuration file "/Users/z/work/.yarnrc".
verbose 0.192732424 Checking for configuration file "/Users/z/.yarnrc".
verbose 0.192809809 Found configuration file "/Users/z/.yarnrc".
verbose 0.192994673 Checking for configuration file "/Users/.yarnrc".
verbose 0.196011087 current time: 2022-06-29T01:58:26.170Z
[1/4] 🔍 Resolving packages...
verbose 0.464574716 Performing "GET" request to "https://registry.yarnpkg.com/html2canvas".
verbose 0.619253995 Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
at TLSSocket.emit (node:events:390:28)
at TLSSocket._finishInit (node:_tls_wrap:944:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
error An unexpected error occurred: "https://registry.yarnpkg.com/html2canvas: unable to get local issuer certificate".
info If you think this is a bug, please open a bug report with the information provided in "/Users/z/work/littlepawcraft/mawsay/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Check if your .npmrc does not specify manual CAs.
Check if you are behind a corporate proxy.
Check if your local certificates are corrupted.

Electron Builde errror on GitLab CI

On GitLab CI the electron build fails with: x509: certificate signed by unknown authority
Since we have set the env-var GIT_SSL_NO_VERIFY to true, this should not happen, right? GitLab Docs
Any idea how to fix this?
Relevant log output:
$ export GIT_SSL_NO_VERIFY=true
..
> nx run dmc-el:make
*********************************************************
DO NOT FORGET TO REBUILD YOUR FRONTEND & BACKEND PROJECTS
FOR PRODUCTION BEFORE PACKAGING / MAKING YOUR ARTIFACT!
*********************************************************
• electron-builder version=22.14.13 os=5.4.109+
• skipped dependencies rebuild reason=npmRebuild is set to false
• packaging platform=linux arch=x64 electron=18.3.4 appOutDir=dist/apps/dmc-executables/linux-unpacked
⨯ Get "https://github.com/electron/electron/releases/download/v18.3.4/electron-v18.3.4-linux-x64.zip": x509: certificate signed by unknown authority
github.com/develar/app-builder/pkg/download.(*Downloader).follow.func1
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:206
github.com/develar/app-builder/pkg/download.(*Downloader).follow
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:234
github.com/develar/app-builder/pkg/download.(*Downloader).DownloadNoRetry
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:128
github.com/develar/app-builder/pkg/download.(*Downloader).Download
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:112
github.com/develar/app-builder/pkg/electron.(*ElectronDownloader).doDownload
/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:192
github.com/develar/app-builder/pkg/electron.(*ElectronDownloader).Download
/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:177
github.com/develar/app-builder/pkg/electron.downloadElectron.func1.1
/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:73
github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2
/Volumes/data/Documents/app-builder/pkg/util/async.go:68
runtime.goexit
/usr/local/Cellar/go/1.16.5/libexec/src/runtime/asm_amd64.s:1371
Error: /builds/daqmon/src/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
at ChildProcess.<anonymous> (/builds/daqmon/src/node_modules/builder-util/src/util.ts:250:14)
at Object.onceWrapper (node:events:642:26)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Notes:
when we execute the same commands in a local docker container (same image as used by GitLab CI), it works
The error was not related to git, so GIT_SSL_NO_VERIFY was useless.
The error occurred when electron-builder tried to download some files from GitHub via https.
The solution is to update the CA certficates in the docker-container before executing electron-builder:
apt-get update && apt-get --yes install ca-certificates && update-ca-certificates
I guess that my local docker-container had newer certificates for some reason, than the GitLab CI docker-container.
Thanks Jonas V for the helpful comment!

Sitespeed.io and graphite

I m actually trying to use sitespeed.io and graphite together and I m facing a problem.
In fact, I want to use this commande line :
sitespeed.io -u http://google.com -b firefox --graphiteHost http://127.0.0.1:3000 --graphiteNamespace sitespeed.io.newyork
and here's the error that I get :
error: Error getting versions: { [Error: Command failed: /home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs --version
/home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
]
killed: false,
code: 127,
signal: null,
cmd: '/home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs --version' }
error: Error: Command failed: /home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs --version
/home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
at ChildProcess.exithandler (child_process.js:744:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Socket.<anonymous> (child_process.js:1176:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:476:12)
I dont know how to work through this and to well generate my sitespeed report.
Any ideas ?
If graphite is running on same host or different host doesnt matter- but carbon will be listening on 2003 and not 3000... 3000 is grafana default port.
you cannot pass the port like a normal url... if u want to pass graphite port to sitespeed... use --graphitePort 2003 or wherever your carbon is listening.

hubot fails to start with flowdock adapter

node: 0.10.0
npm: 1.2.14
I've set the environment variables HUBOT_FLOWDOCK_LOGIN_EMAIL and HUBOT_FLOWDOCK_LOGIN_PASSWORD, and then tried the following.
Pulled down the prebuilt hubot from the hubot site.
Modified the package.json as above.
Run npm install
Added
"hubot-flowdock": ">= 0.0.1",
just underneath dependencies in my package.json
Removed redis from hubot-scripts.json
run npm install
then running ./bin/hubot -a flowdock -d
With this implementation, ./bin/hubot - flowdock
Produces the following stacktrace:
TypeError: Uncaught, unspecified "error" event.
at TypeError (<anonymous>)
at Session.EventEmitter.emit (events.js:74:15)
at Request._callback (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/lib/flowdock.js:49:17)
at Request.self.callback (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:122:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:661:16)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:623:14)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:870:14
Looking at /Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/lib/flowdock.js:49:17, that is a fail on a response statusCode > 300.
So far so good. Adding a console.log to the line above produces "401" unauthorized.
How? The credentials are correct (I log in with that email/password routinely).
For anyone who cares, eventually I realized that my password was incorrect. I was attempting to use my email password, while the correct answer is to use the password you set up when you first connect to flowdock

Resources