I'm trying to install Meteor on my Mac, following the instructions on their site (https://www.meteor.com/install)
curl https://install.meteor.com/ | sh
However, when I run the command, I get the following error:
sh: line 1: syntax error near unexpected token `newline'
sh: line 1: `<!DOCTYPE html>'
Pretty new to Terminal, so pointers appreciated.
Related
I tried running my expo project for the first time on a new M1 Pro mac. I obtained the following error logs. For context, I am using the fish shell. What is wrong? Are ps and grep obtained through some package(s)?
bananas#MacBook-Pro ~/E/myproject [254]> expo start
WARNING: expo-cli has not yet been tested against Node.js v17.0.1.
If you encounter any issues, please report them to https://github.com/expo/expo-cli/issues
expo-cli supports following Node.js versions:
* >=12.13.0 <13.0.0 (Maintenance LTS)
* >=14.0.0 <15.0.0 (Active LTS)
* >=15.0.0 <17.0.0 (Current Release)
Starting project at /Users/williama/Experiments/prpool
Developer tools running on http://localhost:19002
Opening developer tools in the browser...
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
Error: spawn open ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:475:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
I did not have my PATH set up properly.
Before, I had
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin"
export PATH=$ANDROID_HOME/platform-tools
I realized that the last line was overwriting my PATH variable and throwing away everything set on the first line, since the I was not using the $PATH reference (notice the dollar sign) on the second definition.
export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin"
I am following this guide to install pip: https://www.tensorflow.org/install/pip
When I run this command: . ./venv/bin/activate.fish
I get the following error:
-bash: ./venv/bin/activate.fish: line 4: syntax error near unexpected token -d'
-bash: ./venv/bin/activate.fish: line 4:function deactivate -d "Exit virtualenv and return to normal shell environment"'
Please assist.
thanks
The script activate.fish is intended for fish shell. You're running bash so it's a wrong script for bash. With bash use activate:
. ./venv/bin/activate
The command should be
$ source ./venv/bin/activate
if you are using bash in a Linux machine.
I'm trying to run a small bash script inside my CodeBuild process as per the AWS documentation and this.
deploy.sh can be found in the src/ directory:
#!/bin/bash
pwd=$PWD
for dir in */ ; do
target="$pwd/${dir%/}"
cd "$target"
npm install
sls deploy && sls s3deploy
done
buildspec file:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- cd backend/functions/src
- npm install serverless
build:
commands:
- ls
- ./deploy.sh
after the ls command above in the logs, I can see that deploy.sh is there in the current directory.
Error:
/codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: ./deploy.sh: not found
I've also tried using the command /bin/bash deploy.sh but this results in another error:
deploy.sh: line 2: $'\r': command not found
deploy.sh: line 4: $'\r': command not found
deploy.sh: line 7: $'\r': command not found
deploy.sh: line 8: syntax error near unexpected token `$'do\r''
deploy.sh: line 8: `for dir in */ ; do
(First written as a comment, it solved the problem)
The files were made in Windows.
Change CRLF to LF and the \r is gone.
The first answer by Walter A worked for me, this is what i did .
Opened the file in VS Code
At bottom left corner for Select End Of Line Sequence it showed CRLF
clicked on CRLF and selected LF
Uploaded the file to github and it started working.
Every time when I run a brew command, it will give me several error lines at the beginning. I can't understand what's going on here. Can anyone tell me how I can get rid of the error?
brew
/bin/sh: __rvm_ruby_string_find: line 8: syntax error near unexpected token `('
/bin/sh: __rvm_ruby_string_find: line 8: ` ruby-+([1-9]) | ruby-+([1-9]).+([0-9]) | ruby-1.+([1-9]).+([0-9]) | jruby-[19]*)'
/bin/sh: error importing function definition for `__rvm_ruby_string_find'
/bin/sh: __rvm_project_ruby_env_load_parse_file: line 9: syntax error near unexpected token `('
/bin/sh: __rvm_project_ruby_env_load_parse_file: line 9: ` __rvm_read_lines __variables <( { cat "$1"; echo ""; } | __rvm_sed "${__sed_commands[#]}" )'
/bin/sh: error importing function definition for `__rvm_project_ruby_env_load_parse_file'
/bin/sh: __rvm_remove_without_gems: line 2: syntax error near unexpected token `('
/bin/sh: __rvm_remove_without_gems: line 2: ` __rvm_read_lines __gems_to_remove <('
/bin/sh: error importing function definition for `__rvm_remove_without_gems'
Now I found if I run an illegal command for ruby, it gives me a same error message. So is it because my version problem?
To my mind, you need to install ruby first as the errors you're receiving are coming from BASH (it is trying to parse the script as bash but doesn't succeed). Not sure how you managed to install Homebrew without ruby.
I've had this error due to RVM being source'ed during bash profile setup.
It seems the RVM script cannot handle being sourced multiple times into the same shell.
This was being triggered by commands like ssh-agent, which spawn a new sub-shell, or simply running bash again.
My solution was to wrap the RVM source'ing in my .bashrc with a check for the $rvm_version variable:
if [ -z "$rvm_version" ]; then
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
fi
I have a Sencha Touch application I am trying use JSBuilder to build which I am running this script in my Terminal:
bash JSBuilder.sh -v -p airside.jsb3 -d .\AirSide
But I am receiving this error:
JSBuilder.sh: line 11: ./jsdb/mac/jsdb: Permission denied
I am not sure how to fix this or what I am doing wrong?
Try putting sudo in front of the bash