Concurrently path failure - windows

Question Description
I'm trying to simultaneously run multiple commands using the Concurrently package.
My package.json:
{
"name": "emojifier",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start-dev": "concurrently -c \"yellow.bold,green.bold\" -n \"SERVER,BUILD\" \"./node_modules/.bin/ts-node-dev server/index.ts\" \"ng build --watch\" \"ng serve\""
}
}
This script works fine on Ubuntu and Mac. However, when running it via CMD or Powershell, I get the error:
[SERVER] '.' is not recognized as an internal or external command,
[SERVER] operable program or batch file.
[SERVER] ./node_modules/.bin/ts-node-dev server/index.ts exited with code 1
Why is this happening and what is a proper work-around? Is this a bug with Concurrently?
Debugging Attempts
When I switch the forward-slashes to back-slashes:
concurrently -c "yellow.bold,green.bold" -n "SERVER,BUILD" ".\node_modules\.bin\ts-node-dev.cmd .\server\index.ts" "ng build --watch" "ng serve"
The error is resolved.
If I remove the ./ prefix from the path name, the error changes to:
[SERVER] 'node_modules' is not recognized as an internal or external command,
[SERVER] operable program or batch file.
[SERVER] node_modules/.bin/ts-node-dev server/index.ts exited with code 1

Related

Getting error while bootstrapping opensearch dashboard

I am setting up opensearch dashboard in my windows PC and following below guide -
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md
While bootstrapping, I am getting below error -
PS D:\opensearch\OpenSearch-Dashboards> yarn osd bootstrap
yarn run v1.22.18
$ node scripts/osd bootstrap
info [opensearch-dashboards] running yarn
$ node ./preinstall_check
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "typescript#4.0.2" is incompatible with requested version "typescript#~4.5.2"
success Already up-to-date.
succ yarn.lock analysis completed without any issues
succ 10 bootstrap builds are cached
info [#osd/i18n] running [osd:bootstrap] script
info [#osd/monaco] running [osd:bootstrap] script
info [#osd/opensearch-archiver] running [osd:bootstrap] script
info [#osd/opensearch] running [osd:bootstrap] script
ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: C:\Users\st\AppData\Roaming\nvm\v14.18.2\node_modules\yarn\bin\yarn.js run osd:bootstrap
'rm' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
$ rm -rf target && tsc
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
at makeError (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:25150:11)
at handlePromise (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:24085:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:9051:9
at async scheduleItem (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:10938:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
what I see here is, rm command is not recognized in windows and which is correct.
So how to fix this ?

Breakpoints ignored when debugging ethereum-go in Visual Studio Code with Rich Go extension

I am trying to debug go-ethereum code inside the Visual Studio Code. So far I was able to build debug version of binaries by modifying the Makefile and run the project inside the VS Code with "Rich Go" extension installed.
Entry to the MakeFile:
debug:
# https://ethereum.stackexchange.com/questions/41489/how-to-debug-geth-with-delve?rq=1
#echo building debug version
build/env.sh go build -o ./build/bin/geth -gcflags=all='-N -l' -v ./cmd/geth
#echo end building debug version
#echo "Run \"$(GOBIN)/geth\" to launch geth."
My launch.json file is:
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "exec",
"trace": "verbose",
"remotePath": "${workspaceRoot}",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/build/bin/geth",
"sources": "${workspaceRoot}",
"args": [
],
"showLog": true
},
I am able to run the project inside the Visual Studio Code but all breakpoints are ignored.
Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
This is printout from my debug console:
Verbose logs are written to:
/var/folders/f0/8kqy01l55s3f5b642wc2w47w0000gp/T/vscode-go-debug.txt
10:18:57 AM, 11/14/2018
InitializeRequest
InitializeResponse
Using GOPATH: /Users/work/go
Current working directory: /Users/work/go/efsn/build/bin
Running: /Users/work/go/bin/dlv exec /Users/work/go/efsn/build/bin/geth --headless=true --listen=127.0.0.1:2345 --api-version=2 --log=true --
API server listening at: 127.0.0.1:2345
time="2018-11-14T10:18:57-05:00" level=info msg="launching process with args: [/Users/work/go/efsn/build/bin/geth]" layer=debugger
InitializeEvent
SetBreakPointsRequest
All cleared
Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
All set:[null]
SetBreakPointsResponse
ConfigurationDoneRequest
ContinueRequest
ContinueResponse
time="2018-11-14T10:18:58-05:00" level=debug msg=continuing layer=debugger
INFO [11-14|10:18:59.171] Maximum peer count ETH=25 LES=0 total=25
INFO [11-14|10:18:59.184] Starting peer-to-peer node instance=Geth/v1.8.16-unstable/darwin-amd64/go1.11.2
I have installed following packages needed by Rich Go extension:
go get -u github.com/derekparker/delve/cmd/dlv
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
Any help would be greatly appreciated.
Thanks

Specified query type "Query" not found in document when deploying to heroku

I am trying to deploy a typescript-graphql-postgres server onto heroku. The build was successful, however, when run I get the following from heroku logs:
UnhandledPromiseRejectionWarning: Error: Specified query type "Query"
not found in document. 2018-11-08T08:54:52.660051+00:00 app[web.1]: at
/app/node_modules/graphql/utilities/buildASTSchema.js:184:15
Anyone encountered and know the fix?
btw, when I run on my computer, the code works
Resolved. I need to copy graphql files into the relevant modules folders
below is what I added to my package.json for those who run into the same issue
"build": "rimraf dist && tsc && copyfiles -u 1 src/**/*.graphql dist",

gulp-notify: [Error in notifier] Error in plugin 'gulp-notify' Command failed:

I'm trying to set up a basic workflow with Gulp and I'm getting the following error whenever I call gulp-notify.
Design5-Joel:Sura-child design5$ gulp notify
[14:00:17] Using gulpfile ~/Documents/Websites/atoll-wp/wp-content/themes/Sura-child/gulpfile.js
[14:00:17] Starting 'notify'...
[14:00:17] Finished 'notify' after 10 ms
[14:00:17] gulp-notify: [Gulp notification] Hello Gulp!
[14:00:47] gulp-notify: [Error in notifier] Error in plugin 'gulp-notify'
Message:
Command failed: /Users/design5/Documents/Websites/atoll-wp/wp-content/themes/Sura-child/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier -title "Gulp notification" -message "Hello Gulp!" -appIcon "/Users/design5/Documents/Websites/atoll-wp/wp-content/themes/Sura-child/node_modules/gulp-notify/assets/gulp.png" -json "true"
Details:
killed: true
code: null
signal: SIGTERM
cmd: /Users/design5/Documents/Websites/atoll-wp/wp-content/themes/Sura-child/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier -title "Gulp notification" -message "Hello Gulp!" -appIcon "/Users/design5/Documents/Websites/atoll-wp/wp-content/themes/Sura-child/node_modules/gulp-notify/assets/gulp.png" -json "true"
The strange thing is that everything in the function fires, including the notification, and then exactly 30 seconds later the error comes up. This is particularly a problem if I want to watch a folder.
If anyone else has found a solution to this it would be much appreciated
edit: gulp-notify isn't a mandatory aspect of the function, so the easy solution would be to just disable notify but I'd like to be able to solve this in case I run into similar issues in the future.
I've tried;
updating all dependencies
verifying node's cache
reinstalling all packages
running package.json and gulpfile.js through validators.

Gradle build fail with Cannot run program No such file or directory

I have a gradle build file with the following task which need to run sphinx-build, I'm running it on Mac OS X with the gradle information bellow.
task makeDocs(type:Exec) {
workingDir 'sphinx'
commandLine 'sphinx-build'
args = ["-b", "html", "-d", "build/doctrees", "-t", "$platformDir", "build/ppsource", "build/html"]
}
When I run this task I get the following exception:
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'sphinx-build'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
... 1 more
Caused by: java.io.IOException: Cannot run program "sphinx-build" (in directory "/Users/idoran/Documents/Seebo/dev/SDK/seebosdk_docs/sphinx"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 3 more
Caused by: java.io.IOException: error=2, No such file or directory
When I run sphinx-build from the same terminal everything works fine.
$ gradle --version
------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------
Build time: 2014-11-24 09:45:35 UTC
Build number: none
Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_65 (Oracle Corporation 25.65-b01)
OS: Mac OS X 10.10.5 x86_64
Try stopping the gradle daemon with ./gradlew --stop
I had the same problem with something as simple as:
commandLine = [ "node", "--version"]
It came down to the gradle daemon having a cached location of node which no longer existed (I had updated node sometime before).
You shouldn't use commandLine + args together in a Gradle Exec task. Either use commandLine with executable and all arguments as the value, or executable + args which is the better alternative usually.
I had similar issue.. With Vampire's solution, I was able to step up.. However the issue seems to be the sh file not able to point to the exact file location.
Meaning, even with workingDir (wherein actual sh file resides) set properly, still was getting the following exception.
Caused by: java.io.IOException: error=2, No such file or directory
Finally, this post resolved the issue..
Though the original issue of this post's question is already resolved, thought of sharing this solution of adding the absolute file path to actual sh file would resolve the "No such file or directory" issue to someone in the future..
I ran into similar issue and got it resolved with absolute path reference to sh file.
Mine was,
workingDir = "path_to_the_actual_sh_file_to_be_executed"
executable = new File(workingDir, 'actual.sh')
args = ['configure', 'manageRepo', '-tenant', 'etc...']
This error can occur for a couple different reasons. Unfortunately it is not always clear from the error message which one is the problem.
workingDir does not exist. Make sure the specified directory exists before your task runs, or create it in a doFirst block like this:
task makeDocs(type: Exec) {
workingDir 'sphinx'
executable 'sphinx-build'
args = ["-b", "html", /* other args... */]
doFirst {
workingDir.mkdirs()
}
}
The specified executable does not exist or is not on the path. As other answers mention, make sure you are either specifying only commandLine, or both executable and args. So either:
commandLine "sphinx-build", "-b", "html"
or equivalently,
executable = "sphinx-build"
args = ["-b", "html"]
My gradle file contained a snippet to get the aws auth token and I was getting the same failure - Caused by: java.io.IOException: error=2, No such file or directory
In my case, the issue was not caused due to caching.
It was due to gradle not being able to find the aws binary.
What worked for me - Use the which aws command to find the absolute path to aws binary and use it for the binary as shown below. Hope this helps someone with similar issue.

Resources