Unable to install Solana tool suite (Windows) - windows

I followed this guide:
https://docs.solana.com/cli/install-solana-cli-tools#:\~:text=Windows-,Download%20the%20binaries%20by%20navigating%20to%20https%3A%2F%2Fgithub.com,archive%20using%20WinZip%20or%20similar.
However, when i proceed with the steps it doesn't seem to work right. I have tried so many options. Ubuntu works however i do not want to use the platform because there is some confusion for me.
Basically when I run this command:
curl https://release.solana.com/v1.10.4/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs
The output is the file that I have attached.
But then, when I run this command,
C:\solana-install-tmp\solana-install-init.exe v1.10.4
This is the output: The system cannot execute the specified program.
When i run the same command in PowerShell, it says "The file or directory is corrupted and unreadableAt line:1 char:1 +C:\solana-install-tmp\solana-install-init.exe v1.10.4.
I am not quite sure what to do so I can install this Solana tool suite.
Thanks in advance!
I have tried many things, I am not going to be using ubuntu ever again, i want everything to be with cmd and in the windows 10 system while coding in VSC.

I figured out the issue.
There aren't Windows compatible files (.exe) for all of the Solana releases. The guide tells you to use v1.10.4, but after manually going through the releases on GitHub, I found that v1.9 is the latest version with an EXE listed. So run the commands as the guides describe but instead of v1.10.4, pass v1.9.7 like this:
https://release.solana.com/v1.9.7/solana-install-init-x86_64-pc-windows-msvc.exe
After download completes, when it's time to run the next command, do the same thing, substitute 1.10.4 with 1.9.7 like this:
C:\solana-install-tmp\solana-install-init.exe v1.9.7
This will install Solana, and from there, you can follow the guide accordingly. When you run solana-install update, it should update from v1.9.7 to v1.9.14.

ok mate, here is the complete solution:
step 1:
open your VScode as a Administartor(right click on the vscode icon, open as adimistartor).
step 2:
Open a new teminal in vscode and paste this link and press enter:
curl https://release.solana.com/v1.9.7/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs
step 3:
Your solana folder should be in this directory as default:
C:\solana-install-tmp\solana-install-init.exe
so find this directory end be sure to be in there with your terminal.
step 4:
type this in the terminal:
solana-install-init.exe v1.9.7
and press enter.
step 5:
once is done, kill the open terminal and open a new one and go again to the same directory C:\solana-install-tmp\ and type just the word:
solana
press enter and you will see all the data successfully installed.
step 6 (last):
in the same terminal type:
solana --version
press enter and you'll see the version which means you got full solana with no issue.

Related

Why /user/local/go isn't recognized as a Go SDK in GoLand

I'm trying to setup GoLand to use WSL 2 as in this guide: https://www.jetbrains.com/help/go/how-to-use-wsl-development-environment-in-product.html
I've installed Go in the Ubuntu distro following the linux instructions on the GoLang website, and go version prints outs the version I downloaded, so it appears that Go is working inside WSL.
So now I tried to create a new project in GoLand, and I'm getting errors, which appear to come from the fact that the SDK isn't loaded in GoLand. The guide doesn't offer much guidance on this, so I just tried to add a local SDK.
When I select /usr/local/go I get an error that it's not a valid SDK.
So I created the ~/go directory, and then updated my .zshrc file to export the GOPATH and GOROOT environment variables, even though they already showed up when I ran go env, doing this got them to show up on a simple env call.
But I'm still getting the invalid SDK error like above.
Is there a configuration step I'm missing that isn't spelled out in the guide? I came across this old post about creating symlinks to fake the expected directory structure. I haven't done this because it's a really old post, has comments that say this has been fixed, and seems like a really odd solution.
Support for Go SDK in WSL2 will be available in the next 2021.3 release, please see GO-10618.
October 2021 update.
2021.3 reaches Early Access Program at the moment. GoLand suggests selecting Go SDK on WSL2 mount if the location of the project is on WSL2 as well.
I experienced this on my Debian machine and I wasn't using WSL2. I found that the actual cause of the issue is that Goland is unable to read the directory /usr/local/go/bin due to inadequate permission.
A possible solution is to run the goland.sh script as root. The script can be found in the bin/goland.sh directory of the Goland IDE folder. Here is a simple command to do run Goland as the root
export HISTIGNORE='*sudo -S*' && echo "sudo-password-here" | sudo -S /absolute-path-to-goland.sh
export HISTIGNORE='*sudo -S*' tells bash history to ignore caching any command matching sudo -S* to bash history. This way, your sudo-password isn't saved into the bash-history file.
echo "sudo-password-here" | pipes your sudo password as input to the next command.
sudo -S tells bash to read input for password prompt from stdin, which has been provided through the echo command.
Alternatively, you can just install the latest version of Goland. Hopefully, it doesn't come with this bug

how to press enter on Google Colaboratory

I try to install Anaconda on Google Colaboratory but how to press enter on this?
This question is similar Answer “yes” to terminal on Google Colaboratory
Welcome to Anaconda3 5.1.0
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
What can I do?
You can use the -b option to run the installer in batch mode.
!./miniconda.sh -b
It assumes that you agree to all the terms and conditions. But do keep in mind that this doesn't add the installation path to PATH variable which you will have manually set if you directly want to use the conda command using:
!export PATH=$PATH:<dir_of_conda_installation>/bin

How Do I Build Hadoop From Source Without Errors

I have spent weeks trying to resolve different errors in building Hadoop. SO was helpful in pointing me towards the answer to an occasional problem, but after a lot of searching here on SO, I was never able to get the whole thing to build.
It’s been a couple of weeks since all this started so I have forgotten most of the explicit error messages, but the problems I had included
Protobuff versions being wrong
SSH connections not working
Mojofailure Exceptions during build
Incorrect Java versions being used
C++ sanity checks failing
a host of other crap that made no sense to me and I couldn't decipher root causes for
Today I finally got Hadoop to build from the git repo source and wanted to record the process for the SO community members that face similar problems.
For those of you trying to build Hadoop from source, here is how I got everything to compile from source.
Some notes on configuration:
I am installing Hadoop in a virtual environment, in my case VirtualBox.
The Host machine runs Windows 7 x64
The Guest VM runs CentOS 7 x64
I am aiming for the bare minimum installation
How to Build Hadoop From Source Without Errors
Preliminary Downloads:
You need to download the following before you begin.
Virtual Box (I used version 4.3.16 r95972 available here: old VB builds)
CentOS 7 minimal iso file from - http://www.centos.org/download/
WinSCP (version 5.7.4) - https://winscp.net/eng/download.php
This walk through consists of 4 Phases
Create a CentOS Appliance inside VirtualBox that can support
building Hadoop
Add SSH capabilities to the Appliance so that downloaded prerequisites can be scp’ed from the Host to the Guest VM
Install all the things (utilities and dependencies) needed to build Hadoop
Build Hadoop without errors
Phase 1 - Creating a CentOS Appliance for VirtualBox
Start by opening VirtualBox and clicking on the “New” button in the top left corner. This will open a new window asking for some information about the virtual machine appliance you want to create.
Name it “CentOS x64 – Hadoop Base”
Select Linux as the “Type” of operating system
Select RedHat (64 Bit) as the “Version.”
Click “Next”
Follow the remaining prompts in the VM creation wizard. The only things I changed from the defaults where on the “Memory size” passage (I used 4096 MB) and the “File location and size” passage (I used 128 GB). I would encourage you to do the same if your system can support it. Leave all other defaults alone
Click “Create” on the last passage of the VM creation wizard
Once created, the VM will show up on the left hand pane of the VirtualBox Window.
Double click on the VM you just created and wait for the dialog to come up asking you for the iso file you want to use.
When the dialog appears, click on the folder icon on the right and navigate to / select the “CentOS minimal iso” you downloaded during the Preliminary steps.
Once the iso is listed in the drop down box Click “Start”
When prompted, after the VM boots, select “Install CentOS 7” (this is not the default, you have to press the “up” arrow) and press “Enter”. When the setup program loads, the first thing it will ask you about is your keyboard layout. I leave the defaults in place and just click the “Continue” button in the lower right corner. This brings up the Installation Summary page on which you need to make changes to 2 areas: “Installation Destination” and “Network & Host Name”
Click “Installation Destination”
Double Click the virtual disk (make sure that the background is blue and the check mark is there)
Click “Done” to go back to the "Installation Summary" page.
Back on the Installation Summary page,
- Click “Network and Host Name”
- In this menu screen turn on Ethernet networking by clicking the toggle switch on the right.
- Click “Done” in the top left corner.
With both modifications complete you can click the “Begin Installation” button in the bottom right corner. As the iso installs to your system you should take the time to provide a root password by
Clicking on that option at the top left of the page
Filling out the form it brings up
Clicking “Done” (if you select a password considered weak, you have to double click “Done” to accept anyway).
I added a password, but I did not bother to add any non-root users.
Once everything is installed click on the “Reboot” button that appears in the bottom right of the screen.
Once the system reboots select CentOS 7 and allow it to boot. Check your credentials by logging in as root, and then close the CentOS VM by clicking on the red X button at the top right of the window and selecting “Power off the machine” when prompted.
This completes Phase 1
You should now be looking at just VirtualBox
Phase 2 - Adding SSH capabilities to the VM to support download transfers
Open the settings of your CentOS Appliance by first clicking the appliance
Next, click the “Settings” button on the top left of VirtualBox’s main menu. This will bring up a new window.
In the left hand pane of the new window, click on “Network” which will display a set of adapter tabs.
Now click on the Triangle to the left of the label “Advanced”.
This will reveal a series of options, but the one you need to click on is the button labeled “Port Forwarding”
This will bring up another window where you can set port forwarding rules.
Click the green plus sign in the top right corner. This will produce a row where you can enter in a port forwarding rule.
Add the following rule to the row
Name= ssh, Host port =2222, Guest port = 22
Click the “OK” button on the Port Forwarding window
Click the “OK” button on the Appliance Settings window.
With this rule in place you should now be able to ssh from your Windows Host to the CentOS Guest on port 2222 and avoid the following error:
ssh: connect to host localhost port 22: Connection refused
You should now be looking at just VirtualBox again.
Start the CentOS VM appliance and log in as root.
Once logged in, execute the following line from the command prompt.
yum –y install openssh-server openssh-client
This command will install a ssh server on the CentOS VM. After the install, confirm that the ssh server is running by typing the following command.
ps –aux | grep sshd
This command should return 2 processes showing sshd (the ssh daemon). One is the grep command itself. The other is your server running in the background.
Now we need to make sure that ssh did in fact generate the keys it will need to communicate with WinSCP. Issue the following command and make sure that all keys’ byte size values are non-zero.
ls -l /etc/ssh
If the sizes of the keys are 0 bytes, you need to remove them, restart the sshd daemon, and validate that the keys were regenerated when sshd restarted. To do all that, execute the following commands
rm –rf /etc/ssh/ssh*key*
systemctl restart sshd
ls -l /etc/ssh
This processes will help avoid unexpected “connection closed by 127.0.0.1” errors.
Now that we have an ssh daemon up and keys generated, we are going to test the connection. Start by opening WinSCP. And entering in the following values on the start menu that pops up.
Host name = localhost, Port number = 2222, User name = root, Password = , File Protocol = SCP.
Note that you need to set “File Protocol” last. If you don’t, it will try to outsmart you when you enter in a “Port number” that it isn’t expecting. When all the values are entered. Click the “Login” Button and accept / click Update or OK to any security warnings you get.
Once you have logged in, move a file between the Host and VM Guest to confirm everything is working.
Though I won’t focus on it here, you can also us Cygwin to connect to the VM, and it is useful for diagnosing connection problems. The command you need to enter to get verbose diagnostic output is
ssh –vvv –p 2222 root#localhost
This completes Phase 2
Phase 3 - Install Utilities and Dependencies Needed to Build Hadoop
Our CentOS distribution really is “barebones” and so we need to install everything required to build Hadoop. We will do this by downloading most things in Windows and then moving them over to the VM via WinSCP.
Before we start, we need to add a “downloads” directory to the home directory of the root user on the CentOS VM by issuing the following command at the CentOS command line.
mkdir ~/downloads/
We can now begin downloading Hadoop dependencies. We will download everything to Windows and then use WinSCP to move it over to the VM.
Start by downloading the Java 7 JDK from - http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Ignore the “End of Public Updates” error message at the top of the page. Java 7 is what Apache recommends.
You want to download the jdk-7u79-linux-x64.rpm file
Once downloaded use WinSCP to navigate to the Downloads directory of the Host computer and the newly created “downloads” directory of the Guest VM (you may need to click the refresh icon on the VM side of the WinSCP pane to see the directory). Drag and drop the jdk file from the Host over to the VM Guest.
Now we just need to install the JDK on the CentOS VM. From the CentOS command line change your directory to the “downloads” folder we created under root’s home, once in the “downloads” directory use rpm to install java 7.
cd ~/downloads
rpm –ihv jdk-7u79-linux-x64.rpm
Once installation is complete, you can verify it by typing
java –version
Which will produce output stating that you have a Java Run Time Environment installed.
Next we are going to install a subset of the packages Hadoop needs to build successfully. The list is taken straight from the Apache website: https://wiki.apache.org/hadoop/HowToContribute and the command we need to enter on the command line to retrieve them is:
yum -y install lzo-devel zlib-devel gcc autoconf automake libtool openssl-devel fuse-devel
Next we are going to install Apache’s Maven. You can download it here:
https://archive.apache.org/dist/maven/binaries/
Apache’s website says you can use version 3+. I used version 3.2.2 so download this file to follow along:
apache-maven-3.2.2-bin.tar.gz
Once you have the file downloaded, use WinSCP to move it from your host computer to the Guest VM ‘s “downloads” folder just like you did with the JDK file. We then untar the file into the /usr/local/ directory, and create a symbolic link in the /usr/local/ directory that points to the maven folder with the following three commands.
tar xzf apache-maven-3.2.2-bin.tar.gz -C /usr/local
cd /usr/local
ln -s apache-maven-3.2.2 maven
We now need to add Maven’s bin directory to the $PATH variable. We do so by editing the .bashrc file in root’s home directory. Open the file for editing in vi by using the following command
vi ~/.bashrc
This will bring up the bash file in the vi editor ( if you need it, a tutorial on vi can be found here: http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html ) follow these instructions to correctly update the file.
Enter Edit mode by pressing the “a” key
Add the following lines to the file:
export M2_HOME=/usr/local/maven
export PATH=$M2_HOME/bin:$PATH
Press the “Esc” key to leave Edit mode
Type “:wq” – it will automatically show up at the vi command line (bottom left of the screen)
Press “Enter”
Now log out of CentOS. Log back into CentOS, and check to make sure that the new PATH variable is appropriately set using the following commands.
exit
<log back in as root>
mvn –version
you should see output indicating that maven is currently installed
Next we need to install C++ support for gcc. We do that with the following one line command
yum –y install gcc-c++.x86_64
Next we need to install git so that we can pull down the Hadoop source code.
yum –y install git
Once you have git. Go ahead and pull down the Hadoop source. There is still one more thing (ProtocolBuffer) we need before we can build the source code, but we need to see the BUILDING.txt file in the repo before we download ProtocolBuffer to make sure that we get the right version.
To get the Hadoop source we run the git clone command. Simply execute the following commands from the CentOS command line to download the Hadoop repo.
cd /usr/local
git clone git://git.apache.org/hadoop.git
The clone operation will place a “hadoop” directory in your /usr/local directory. When the operation has completed and you have the command prompt back, take a look at the BUILDING.txt file in your new hadoop directory using the following command:
less /usr/local/hadoop/BUILDING.txt
In the “Requirements” section of the file it states the version of ProtocolBuffer we need for Hadoop to build correctly. In this case it’s ProtocolBuffer 2.5.0. With this information in hand we go back to the command prompt by pressing “q” for quit.
Now we can finally, install the last of the things Hadoop needs: ProtocolBuffer. To get the right version of ProtocolBuffer, we visit the ProtocolBuffer release page:
https://github.com/google/protobuf/releases
and scroll down until we see the version needed for Hadoop to compile. For this walkthrough you want to download the following file.
protobuf-2.5.0.tar.gz
Once downloaded, use WinSCP and transfer it to the VM’s “downloads” folder like you did earlier for the other downloads. Once the file is sitting in the VM’s “downloads” folder, issue the following commands to install ProtocolBuffer on CentOS
cd ~/downloads
tar xzf protobuf-2.5.0.tar.gz -C /usr/local
cd /usr/local/protobuf-2.5.0
./configure
`make'
make install
Once this is done all the prerequisite utilities and dependencies needed for building Hadoop will be installed.
This completes Phase 3
Phase 4 - Build Hadoop Without Errors
Go to the Hadoop directory, and run Maven skipping the tests using the following commands:
cd /usr/local/hadoop
mvn clean install -DskipTests
The build should now occur without any problems and when everything is finished, you should see a screen like the one below.
This completes the walk through
I hope some of you find it helpful.
I know this was a question of how to build hadoop from source, but after running into a variety of errors throughout the build process, I found this extremely helpful. Someone has already built Hadoop on Windows and posted the binaries. I setup this version on my Windows machine and it is working great:
http://www.barik.net/archive/2015/01/19/172716/

'npm' is not recognized as internal or external command, operable program or batch file

I am completely new to nodejs. I am trying to get nodejs to work on my Windows 2008 box in order to install Karma which I would use for TDDing my AngularJs code. I have done the following steps so far
Install using Chocolatey ==> npm is not recognised
Install using 64-bit nodejs installer from nodejs.org ==> npm is not recognised
At this stage, running where npm gives me c:\User\<Username>\AppData\Roaming\npm which has nothing in it
I figure out that nodejs is installed in C:\Program Files\nodejs. Opening a command prompt in this directory makes npm work fine.
So I added C:\Program Files\nodejs to PATH only to get the same error again that npm is not recognized
One of the github issues on nodejs repository says that I need to restart the machine and it would fix. But that has not helped so far
I do see a Node.js icon in my Start -> Programms mennu which takes me to nodejs console but not sure what to do with that.
Have I missed any important step in the process?
Edit
I figured out that if I open "Nodejs command prompt" from program files, then npm is recognized. How do I make it work on a normal command prompt?
Edit
After node I started facing a similar problem with another application. I posted this question on superuser and as rightly pointed out by the accepted answer, I had an additional quote in my PATH which was causing issues with all the paths added after the quote. I have a feeling that some Chocolatey install adds this troubling quote but I am just not sure which one.
Just add:
;C:\Program Files\nodejs\
To the end of your Path variable on the "User variable" section of the Environment Variables on the System Properties.
After that, reopen your command prompt and type
npm
This should work.
Don't forget to reboot your computer after installing node! That one got me.
If you are using VS Code, close VS code and open again.
I tried closing Terminal and then opening new Terminal but it didn't work.
Re-Starting VS Code works!
To elaborate on Breno's answer... For Windows 7 these steps worked for me:
Open the Control Panel (Click the Start button, then click Control Panel)
Click User Accounts
Click Change my environment variables
Select PATH and click the Edit... button
At the end of the Variable value, add ;C:\Program Files\nodejs
Click Ok on the "Edit User Variable" window, then click Ok on the "Environment Variables" window
Start a command prompt window (Start button, then type cmd into the search and hit enter)
At the prompt (C:\>) type npm and hit enter; you should now see some help text (Usage: npm <command> etc.) rather than "npm is not recognized..."
Now you can start using npm!
For Windows users: A picture tells a thousand words
Reference: npm not recognized as internal or external command (Note: this is my own blog)
Just Download and Install Node.js from here https://nodejs.org/en/
If you run the downloaded file and install it, they will automatically configure for your system
You don't need any other configurations anymore, now you can use the npm command anywhere
If the Nodejs is successfully installed and still displays the message like this:
'npm' is not recognized as an internal or external command, operable program or batch file.
Follow the steps below for Windows users:
Go to My Computer Properties
Click Advanced System Setting from the Left bar of a window.
Now you have a System Properties window. Click Advanced
Then, Click Environment Variable button
Now you have Environment variable window: From System Variable, Select Path
Click Edit
At the end of the Variable value, add ;C:\Program Files\nodejs\
Note: If you have installed nodejs on other drives then please act accordingly.
Click Ok all the open dialogue box
Very important Note: "Close your Command Prompt And Restart Again"
(It's very important because if you didn't restart your command prompt then changes will not be reflected.)
Now you can use the npm command anywhere
Don't forget to run cmd as admin.
I understand this question is really old and we have many answers, unfortunately, my scenario was different, thus a different solution.
If you started using nvm to manage the node versions after you install the node in your machine, most likely you will be facing the same issue.
I installed a version 10.15.3 and then I had to use another version as there is some tight dependency with one of my projects. Then I decided to install the nvm, while installing it asked, whether I need nvm to manage the version already installed on my machine which is 10.15.3. And yeah, I said Yes hoping that it will take care of that, unfortunately, it didn't.
I was always getting this error no matter I tried many other things mentioned in the other answers here, including setting the path. In the end, to fix that, these are the things I tried.
Uninstall the node version installed, for example, nvm uninstall 10.15.3
Make sure no other node versions are there, nvm list
Then, install the version needed, for example, nvm install 10.15.3. This should give you an output as preceding.
Downloading node.js version 10.15.3 (64-bit)...
Complete
Creating C:\Users\SibeeshVenu\AppData\Roaming\nvm\temp
Downloading npm version 6.4.1... Complete
Installing npm v6.4.1...
Installation complete. If you want to use this version, type
nvm use 10.15.3
PS C:\Users\SibeeshVenu> nvm use 10.15.3
Now using node v10.15.3 (64-bit)
Please note that from the above command, the npm is also installed.
Now use the version you need, nvm use 10.15.3 and type npm
I had the same problem described by Ashu, but in addition to that, the PATH entry for nodejs was terminated by a backslash:
C:\Program Files\nodejs\
I also had to remove that final backslash in order to have it work.
I faced the exact same issue and notice that after installing node.js there was a new path entry in the user variable section for PATH with value --> c:\User\\AppData\Roaming\npm. Also the Path entry in the system variable is appended with --> C:\Program Files\nodejs. Now since user variable has preference over system you have two options to fix this. Either delete the path from user variable or correct the right path (C:\Program Files\nodejs). Restart CMD and it should work.
Set aside all the tips, just run the following line in cmd
> SET PATH=C:\Program Files\Nodejs;%PATH%
If you're getting this error through a service account like Visual Studio TFS Build controller service or any other background service, make sure you restart the service after installing npm as the new PATH environment settings will not be picked up by those already running processes. I was getting same error through my build service but I had npm installed and running in the console.
You might have already received a response but this might help others since I experienced the same issue recently and this is what I did:
Added a path for Powershell. For me, the path was C:\Windows\System32\WindowsPowerShell\v1.0
Then, I opened the command prompt with administrative privileges and ran
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Next, choco install nodejs
Restart and everything worked fine. Try opening the command prompt without admin privileges and run npm -v
Cheers.
Had the same problem on Windows 8.1 64 bit.
Turns out i get that problem if I start cmd by typing it in the path bar at the top of a folder window or when i shift right click in a folder window and then open command prompt from the list.
When I run cmd using Run or Just from the cmd.exe executable it works.
I installed nodejs following this AngularJS tutorial. the npm command did work when I open a new cmd window but not in the current one.
So the fix was to close and open a new cmd window.
If the package is successfully installed and still shows the message "'npm' is not recognized as an internal or external command, operable program or batch file."
Click windows start button.
Look for "ALL APPS", you will see Node.js and Node.js Command prompt there.
You can run the Node.js Command prompt as administrator and soon as its run it will show the message "Your environment has been set up for using Node.js 6.3.0 (x64) and npm."
and then it works from there...
I ran into this issue as well. It turns out Windows doesn't enjoy single quotes on the command line. The culprit was one of my npm scripts. I changed the single quotes to escaped double quotes:
'npm -s run sass-build'
to
\"npm -s run sass-build\"
I'm updating this thread with a new answer because I've found the solution to my miserable situation after not less than a week ...
For those still experiencing the error even though they have their path value set properly, check your pathext variable to have the value (default value in windows 7 +) : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Mine was to set only to : .BAT and changing it solved the problem. I wonder why nobody brought this up ...
Hope this helps!
If everything looks fine. I would advice to check this for PATHEXT .CMD must be added.
I don't know why most of user suggesting ; / in the command.
I solved this by removing ; and /
Before
;C:\Program Files\nodejs\
After Solution
C:\Program Files\nodejs
You need to save them into system PATH variables
I ran into this problem the other day on my Windows 7 machine. Problem wasn't my path, but I had to use escaped forward slashes instead of backslashes like this:
"scripts": {
"script": ".\\bin\\script.sh"
}
Step 1: install NodeJs
step 2: Set environment path
Step 3: Restart PC once
I installed Node.js and while trying to install Ionic and cordova using this piece of code:
npm install -g cordova ionic
I faced the above error. I added 'C:\Program Files\nodejs' to my Environment Variable 'PATH'. But still was unable to get over this issue. Turned out that my PATH variable was longer than 2048 characters and so I was unable to add the Nodejs path to it. I had to remove the path of another program and add the Nodejs path.
Close and reopen the cmd prompt and try to install Ionic again.
This worked for me.
for me adding path to PATH didn't do the trick.
Run c:\Program Files\nodejs\nodevars.bat instead, it will do the job for you
Well in my case doing testing via Mocha i tried everything just to realize i have to remove single quotes around my test case script tag inside package.json.
I am running mocha test case on all *.test.js files as can see below:
package.json
Before:
"scripts": {
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec 'npm run test'"
}
After(removing single quotes - npm run test):
"scripts": {
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec npm run test"
}
Worked for me, just in case someone else also gets stuck on this.
Check npm config by command:
npm config list
It needs properties: "prefix", global "prefix" and "node bin location".
; userconfig C:\Users\username\.npmrc
cache = "C:\\ProgramData\\npm-cache"
msvs_version = "2015"
prefix = "C:\\ProgramData\\npm"
python = "C:\\Python27\\"
registry = "http://registry.com/api/npm/npm-packages/"
; globalconfig C:\ProgramData\npm\etc\npmrc
cache = "C:\\ProgramData\\npm-cache"
prefix = "C:\\ProgramData\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\WINDOWS\system32
In this case it needs to add these paths to the end of environment variable PATH:
;C:\Program Files\nodejs;C:\ProgramData\npm;
If you used ms build tools to install node the path is here:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\NodeJs
You don't need to "install" Node.js. Just download the package from https://nodejs.org/en/download/releases/ and extract the contents somewhere. Then, in a command prompt, you can navigate there using cd. Then you can run npm from that location. While you will have to do the cd C:\Users\YourAcct\Documents\node-v16.13.0-win-x64 or similar command before you can run it, it's a way to get it onto your computer and run npm without having to be an admin or editing environmental variables.
The issue is with system policy. I have tried the following comments in powers heel then it is started working
$> Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
$> npm install -g npm-windows-upgrade
$> npm-windows-upgrade
I got this idea from the following link
After adding environment varible path restart your machine maybe this will work. it work for me. i was using vm.

OSX Equivalent of WinSCP's Fully-Automated Local-Remote SFTP Sync?

I fondly remember working with WinSCP and using the fully automated local-to-remote syncing functionality, where the app would monitor a directory hierarchy and send changes to the remote server as they happened.
Is there an app available on OSX that accomplishes the same thing? I haven't really been able to find anything. When I do find something promising, it always turns out to be a traditional syncing app, where you need to initiate the sync command manually and it then scans the hierarchy to find changed files. That takes too long and isn't automated.
Been looking at the File System Events API, wondering if a small app could be pieced together with a small utility to trigger hierarchy changes and feed the changed directory to rsync or something.
Thanks for any leads!
There are two Mac-specific utilities you may be able to utilize to make your job easier:
Automator (link and link)
Folder Actions (link link and link)
Both tools have AppleScript as a common thread (which can be used to execute shell commands). You might be able to write a small AppleScript that is launched when a folder changes to call rsync and perform the service you require.
Well, I had the same kind of problem and it is possible using these together: rsync, SSH Passwordless Login, Watchdog (a Python sync utility) and Terminal Notifier (an OS X notification utility made with Ruby. Not needed, but helps to know when the sync has finished).
I created the key to Passwordless Login using this tutorial from Dreamhost wiki: http://cl.ly/MIw5
1.1. When you finish, test if everything is ok… if you can't Passwordless Login, maybe you have to try afp mount. Dreamhost (where my site is) does not allow afp mount, but allows Passwordless Login. In terminal, type:
ssh username#host.com
You should login without passwords being asked :P
I installed the Terminal Notifier from the Github page: http://cl.ly/MJ5x
2.1. I used the Gem installer command. In Terminal, type:
gem install terminal-notifier
2.3. Test if the notification works.In Terminal, type:
terminal-notifier -message "Starting sync"
Create a sh script to test the rsync + notification. Save it anywhere you like, with the name you like. In this example, I'll call it ~/Scripts/sync.sh I used the ".sh extension, but I don't know if its needed.
#!/bin/bash
terminal-notifier -message "Starting sync"
rsync -azP ~/Sites/folder/ user#host.com:site_folder/
terminal-notifier -message "Sync has finished"
3.1. Remember to give execution permission to this sh script. In Terminal, type:
sudo chmod 777 ~/Scripts/sync.sh
3.2. Run the script and verify if the messages are displayed correctly and the rsync actually sync your local folder with the remote folder.
Finally, I downloaded and installed Watchdog from the Github page: http://cl.ly/MJfb
4.1. First, I installed the libyaml dependency using Brew (there are lot's of help how to install Brew - like an "aptitude" for OS X). In Terminal, type:
brew install libyaml
4.2. Then, I used the "easy_install command". Go the folder of Watchdog, and type in Terminal:
easy_install watchdog
Now, everything is installed! Go the folder you want to be synced, change this code to your needs, and type in Terminal:
watchmedo shell-command
--patterns="*.php;*.txt;*.js;*.css" \
--recursive \
--command='~/Scripts/Sync.sh' \
.
It has to be EXACTLY this way, with the slashes and line breaks, so you'll have to copy these lines to a text editor, change the script, paste in terminal and press return.
I tried without the line breaks, and it doesn't work!
In my Mac, I always get an error, but it doesn't seem to affect anything:
/Library/Python/2.7/site-packages/argh-0.22.0-py2.7.egg/argh/completion.py:84: UserWarning: Bash completion not available. Install argcomplete.
Now, made some changes in a file inside the folder, and watch the magic!
I believe transmit does this.

Resources