windows 10 -'bash' is not recognized as an internal or external command, operable program or batch file [duplicate] - c++

i have an error in installing react-flux-starter-kit-windows.
i have installed latest node.js and npm
when i am using this command :
npm install -g react-flux-starter-kit
it gives me following error
react-flux-starter-kit#1.1.4 postinstall C:\Users\Hardik\AppData\Roaming\npm\node_modules\react-flux-starter-kit
bash setup.sh
'bash' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Hardik\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "react-flux-starter-kit"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-flux-starter-kit#1.1.4 postinstall: bash setup.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-flux-starter-kit#1.1.4 postinstall script 'bash setup.sh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-flux-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bash setup.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs react-flux-starter-kit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls react-flux-starter-kit
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Hardik\AppData\Roaming\npm-cache_logs\2017-02-22T10_01_48_356Z-debug.log

It seems that it needs Bash installed. If you're using Windows then you may be able to install it using one of:
https://git-for-windows.github.io/
https://www.cygwin.com/
https://msdn.microsoft.com/en-us/commandline/wsl/about
http://win-bash.sourceforge.net/

Go with the steps
Setting->update->for developers->developers mood->on->yes.
Control Panel->programs & features->Turn windows features on or off->Windows subsystem for linux->restart computer.

The same error can appear if the bash isn't present in path env, so you need to add it manually.
Add this directory to your path env:
C:\Program Files\Git\bin

I had the same problem and I solved it in 2 stages:
First, I turned on the 'Developer Mode' (Settings -> Update and Security -> For developers).
Second, I installed Ubuntu app from Microsoft Store, then ran Command Prompt as administrator and typed bash and set a username and password.

To fix this on Windows, if you install git for windows you will get git.exe at this directory:
C:\Program Files\Git\cmd
but the file is git.exe and you need bash.exe for Windows.
So use this to create a doskey alias to bash command
doskey bash=git
Now type bash at command line and you should see the help output from git.exe.

If you're using Windows then you may be able to use GIT Bash which you probably already have it installed or get it from https://gitforwindows.org/ instead of using Windows Command Prompt or Windows PowerShell.

Related

Not able to create a new ember app - Could not resolve dependency error

I'm just trying to create a new app from scratch, but getting this error:
Command failed with exit code 1: npm install --loglevel error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ember-sample#0.0.0
npm ERR! Found: ember-cli#4.3.0
npm ERR! node_modules/ember-cli
npm ERR! dev ember-cli#"~4.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer ember-cli#"~3.2.0" from ember-cli-dependency-checker#3.3.0
npm ERR! node_modules/ember-cli-dependency-checker
npm ERR! dev ember-cli-dependency-checker#"^3.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
These are the repro steps:
open command prompt in Win11.
install ember
npm install -g ember-cli
create app ember-sample
ember new ember-sample
and just after that I get the error above.
Could I be missing anything? I have already installed node v16.14.2, npm 8.5.0, ember-cli: 4.3.0
I was already taking a look on ember.js official website
Actually Ember CLI is Compatible with NodeVersion 12. You might be using a later node versio like 14 or 16. My problem is solved when I downgraded to Node 12 lts
A fix is on its way. You could follow what #NullVoxPopuli said in the comments.
https://github.com/quaertym/ember-cli-dependency-checker/issues/132

Unable to install nodemon globally through terminal, showing an error

If I give as npm install -g nodemon
getting an error as :
checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
Please any suggestions.
You need root permissions: try with
sudo npm install -g nodemon
This is a permission error and you can use sudo, But Running sudo npm install (without -g) will create a local directory that can only be altered by the root user. This can really screw things up for you if you try to do npm <something> in the same directory or project later on.
Even sudo npm install -g with a valid installation target can mess things up for you and make it hard to use npm without sudo under some circumstances in the future particularly if you change your npm configuration midstream.
you can use the following steps to update your local OS:
Set your prefix for global installs, e.g. npm config set prefix ~/.npm
Update your PATH to include ~/.npm/bin. For example: echo 'export PATH="$HOME/.npm/bin:$PATH"' >> ~/.zshrc if you’re using zsh.
See Don’t Use sudo with npm for more information.

Build failing while deploying Perishable network on IBM cloud Blockchain starter plan

nvm_tree_contains_path /home/pipeline/.nvm /home/pipeline/.nvm/versions/node/v8.15.1
'[' -n 'Now using node v8.15.1 (npm v6.4.1)' ']'
nvm_echo 'Now using node v8.15.1 (npm v6.4.1)'
command printf '%s\n' 'Now using node v8.15.1 (npm v6.4.1)'
node -v
Now using node v8.15.1 (npm v6.4.1)
npm -v
v8.15.1
6.4.1
test_contracts
for CONTRACT in '${CONTRACTS}'
test_contract iot-blockchain-perishable-network
CONTRACT=iot-blockchain-perishable-network
'[' -f contracts/iot-blockchain-perishable-network/package.json ']'
test_composer_contract iot-blockchain-perishable-network
CONTRACT=iot-blockchain-perishable-network
echo testing composer contract iot-blockchain-perishable-network
pushd contracts/iot-blockchain-perishable-network
npm test
testing composer contract iot-blockchain-perishable-network
~/bc70ab6b-afeb-4ddf-a8ee-ddb7b7e23ce1/contracts/iot-blockchain-perishable-network ~/bc70ab6b-afeb-4ddf-a8ee-ddb7b7e23ce1
perishable-network#0.2.6-deploy.2 pretest /home/pipeline/bc70ab6b-afeb-4ddf-a8ee-ddb7b7e23ce1/contracts/iot-blockchain-perishable-network
npm run lint
perishable-network#0.2.6-deploy.2 lint /home/pipeline/bc70ab6b-afeb-4ddf-a8ee-ddb7b7e23ce1/contracts/iot-blockchain-perishable-network
eslint .
sh: 1: eslint: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! perishable-network#0.2.6-deploy.2 lint: eslint .
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the perishable-network#0.2.6-deploy.2 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pipeline/.npm/_logs/2019-03-06T14_37_44_449Z-debug.log
npm ERR! Test failed. See above for more details.
Finished: FAILED
You will just need to run npm install and see if everything was successfully installed. Because the project will run inside IBM Blockchain, you dont need to run it locally.
For a more detailed information on how to achieve your gold, check this answer:
https://stackoverflow.com/a/55358606/7004017

AWS-Amplify-cli fails to install on Mac

Trying to install AWS-Amplify-CLI and followed this
When I run npm install -g #aws-amplify/cli or sudo npm install -g #aws-amplify/cli I get the following errors
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents#1.2.7 and node#11.8.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/lib'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/build'
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/lib/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64" "--napi_version=4" "--node_abi_napi=napi"
gyp ERR! cwd /usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents
gyp ERR! node -v v11.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/lib/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:978:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 18.2.0
node-pre-gyp ERR! command "/usr/local/lib/node_modules/node/bin/node" "/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents
node-pre-gyp ERR! node -v v11.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/lib/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/node/lib/node_modules/#aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi' (1)
npm WARN graphql-import#0.4.5 requires a peer of graphql#^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/#aws-amplify/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
#aws-amplify/cli#0.1.44
added 2 packages from 1 contributor, removed 6 packages and updated 29 packages in 57.461s
When I install node-pre-gyp and node-gyp separately, I get the same errors.
I have CHMOD 0777 on the project folder and then tried to install again without the -g flag, but same error.
OS: Mojave 10.14.2
Node: v11.8.0
npm: 6.5.0
You may also try the following command that worked for me :
sudo npm install -g #aws-amplify/cli --unsafe-perm=true
Fixed.
It seems that there was an issue with my global installation of node and npm, missing/incorrect entries in:
~/.bash_profile
~/.bashrc
The fix was to totally remove node & npm, the re-install using nvm. I followed these:
https://github.com/brock/node-reinstall/
https://gist.github.com/d2s/372b5943bce17b964a79
Please note:
you may need to remove some node or npm files manually
you may need to upgrade node and/or npm afterwards
you may need to reinstall individual node packages afterwards.
I had a similar issue. I needed to set the python version for some odd reason. Something like
npm config set python python2.7 && npm install
Amplify needs local resources and needs to be tied to a environment especially if you are switching between them.
Like dev/prod or local dev on a Mac vs some dev in windows.
Look at amplify env add
I had node installed via brew so my fix was:
uninstall node completely
brew uninstall --force node
install node via: https://nodejs.org/es/ which updates PATH automatically
install amplify:
sudo npm install -g #aws-amplify/cli --unsafe-perm=true
This is what I did to solve this:
Re-install node to the latest version. You can do that using the following steps:
- sudo npm cache clean -f (force) clear you npm cache
- sudo npm install -g n install n (this might take a while)
- sudo n stable upgrade to the current stable version
Note that sudo might prompt your password.
Install amplify:
sudo npm install -g #aws-amplify/cli --unsafe-perm=true
This last process may take a while.
EACCES permissions errors when installing packages globally
First uninstall amplify
npm uninstall -g #aws-amplify/cli
or
sudo amplify uninstall
Reinstall npm with a node version manager, I recommend this guide https://tecadmin.net/install-nvm-macos-with-homebrew/
On command line create a directory for global installations
mkdir ~/.npm-global
Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
For versions after MacOS Catalina uses nano ~/.zshrc and for versions before this version uses nano ~/.profile and add the next line
export PATH=~/.npm-global/bin:$PATH
On the command line, update your system variables. If you used ~/. zshrc
source ~/.zshrc
If you used ~/. profile
source ~/.profile
Then try to install amplify
npm install -g #aws-amplify/cli
While the accepted solution seemed to work initially, I encountered further EACCES: permission error while using amplify-cli. The way I got it solved is by resolving EACESS permissions as recommended by npmjs documentation.
Instructions:
On the command line, in your home directory, create a directory for global installations:
mkdir ~/.npm-global
Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
In your preferred text editor, open or create a ~/.profile file and add this line:
nano ~/.profile
export PATH=~/.npm-global/bin:$PATH
On the command line, update your system variables:
source ~/.profile
Test if the added path is working by looking for the string .npm-global/bin in the outpout:
echo $PATH
Finally, install aws-amplify/cli without using sudo as follows:
npm install -g #aws-amplify/cli

Elastic Beanstalk EBS NPM Bower install is failing

Having an issue with my EBS deployment. Getting this output everytime it tries to deploy the build.
Application deployment failed at 2018-07-02T02:46:14Z with exit status 1 and error: command npm_install_bower in .ebextensions/bower.config failed.
npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm ERR! Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! at SecurePair.<anonymous> (tls.js:1430:32)
npm ERR! at SecurePair.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:1029:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:521:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:341:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:418:25)
npm ERR! at doWrite (_stream_writable.js:226:10)
npm ERR! at writeOrBuffer (_stream_writable.js:216:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR! at write (_stream_readable.js:602:24)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 4.14.47-56.37.amzn1.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /opt/elasticbeanstalk/eb_infra
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /opt/elasticbeanstalk/eb_infra/npm-debug.log
npm ERR! not ok code 0.
bower.config file is:
commands:
get_sudo:
command: echo Defaults:root \!requiretty >> /etc/sudoers
npm_install:
command: sudo yum -y --enablerepo=epel install nodejs npm
npm_install_bower:
command: sudo npm install -g bower
container_commands:
01_bower_install:
command: "export PATH=$PATH; $NODE_HOME/bin/node ./node_modules/bowe/bin/bower -V install --allow-root -F > /tmp/01_bower_install.log"
Tried it without 01_bower_install part as well but same result. Fails to deploy. Was working fine until 2 days ago on the instance and now showing:
Forbidden You don't have permission to access / on this server.
..on the URL.
Help greatly appreciated!
I spent few hours today on the same issue, bower would not be installed by npm and would not run. Eventually got it work as follows:
1) remove "bower" from package.json
2) here is my ebextension file that managed to install bower and run it, by making it a global command:
container_commands:
install_bower:
command: "export PATH=$PATH:$NODE_HOME/bin; npm install bower -g; bower install --allow-root"
Cheers,
Z.