"CALL "C:\Program Files\nodejs\\node.exe" Error - javascript

I have been trying insall node js and install browser sync
C:\Users\Aly>npm install -g browser-sync
'CALL "C:\Program Files (x86)\nodejs\\node.exe" "C:\Program Files `(x86)\nodejs\\`
node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,operable program or batch file.
Even if i want to know my node js version , the same error appear and then the version shown after that
C:\Users\Aly>npm --version
'CALL "C:\Program Files (x86)\nodejs\\node.exe" "C:\Program Files `(x86)\nodejs\\`
node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,operable program or batch file.
3.10.9
Windows 10
Thanks So Much In Advance

I just spend way to long with this issue. I'm not sure how it got set, perhaps during an install, but I changed a System Variable:
Name: ComSpec
Value: %SystemRoot%\system32\cmd.exe;prefix=C:\Program Files (x86)\nodejs\node.exe
To this:
Name: ComSpec
Value: %SystemRoot%\system32\cmd.exe
And restarted my system and the issue was gone.

Good catch blur0224.
I also spent way too long on this issue reinstalling node in various ways and investigating administrator privileges for the %appdata%/roaming/npm -folder.
Your solution worked for me also. The ComSpec variable contained old trash (referring to uninstalled programs) which somehow interfered when calling npm.
Side note 1: What was REALLY confusing was that calling npm worked for many npm package retrievals, but not all. Error code in the failed cases would for me contain keywords such as code ELIFECYCLE and errno ENOENT.
Side note 2: I also received warning 1909 could not create shortcut node.js command prompt.lnk when installing node - perhaps implying that an environmental variable was not properly installed.
Anyone seeing the symptoms from the two previous paragraphs could try the answer from blur0224. I hope this helps people searching for these keywords.

Firstly, check using GitBash whether the npm -v command executes successfully.
If NPM is working in GitBash, then it is not a path problem (your path reference is OK).
Go to Environment Variables > System Variables and check if ComSpec: %SystemRoot%\system32\cmd.exe is correctly configured, or not.
In some cases, if you have a trailing slash, it will not work. (eg: ComSpec : %SystemRoot%\system32\cmd.exe\) If so, simple remove the trailing slash.
Otherwise, check where cmd.exe is located and use that path as the ComSpec value.
Usually, it resides at c://Windows/System32/cmd.exe.

Related

NPM START ERROR - This is related to npm not being able to find a file

I have a problem with npm, but specifically when starting my project for a simple server using node.js.
hello network
I have a problem with npm, but specifically when starting my project for a simple server using node.js.
I tried to search in forums, videos and articles but the solutions didn't answer me.
The ERROR says that the package.json file is not in the directory, but it is - and the file contains "start" directing to the nodemon app.js command.
My directory
Error npm
Thank you very much
The error says that cmd.exe; is not found (and not, as you claim, package.json). Note the extra ; at the end which shouldn't be there.
Make sure your system's COMSPEC environment variable doesn't have this spurious semicolon at the end (if it has, remove it and restart your computer) and also that you don't have any .npmrc that overrides the shell with the bad path.

HardHat Unable to download compiler versions list

So this is my first interaction with hardhat. I created a sample project using npx hardhat but for some reason, when I try to Run:
npx hardhat test
I get the following error:
Error HH502: Couldn't download compiler versions list. Please check your connection.
With the following error in the stack trace:
Caused by: FetchError: request to https://binaries.soliditylang.org/windows-amd64/list.json failed, reason: getaddrinfo EAI_AGAIN binaries.soliditylang.org
So I tried navigating to binaries.soliditylang.org with Chrome and I found out that I'm getting net::ERR_NAME_NOT_RESOLVED.
(I get this error even when I try to navigate to docs.soliditylang.org)
I understand it has something to do with DNS but I don't have a clue how to solve it.
I faced similar issue. However, for me hardhat is not able to download list of compiler versions behind corporate proxy. Tried a lot of things. No luck. After a lot of trial and errors, found a way to make this work. Download list.json
and keep it locally at C:\Users\<your-user>\AppData\Local\hardhat-nodejs\Cache\compilers\windows-amd64 (windows). Also, download the solidity compiler executable for windows (required version) from https://github.com/ethereum/solidity/releases and place it in the same folder mentioned above. Now, peruse your list.json and identify the object for the solc compiler version of interest. Rename the executable as with the long name given in path in that object. For e.g., if you need solc version 0.8.0, the path in list.json for 0.8.0 version is solc-windows-amd64-v0.8.4+commit.c7e474f2.exe. Use this to rename the downloaded executable. Now, run npm test. This should fix the issue.
There is also an interesting way to run the compiler within docker on windows. For this, follow the discussion here - https://github.com/NomicFoundation/hardhat/issues/1280
Adding an .env file to the root of the project with
HTTPS_PROXY = ...
Solved in https://github.com/NomicFoundation/hardhat/pull/1291
Had to sudo chmod -R 777 /Users/<username>/Library/Caches/hardhat-nodejs first.

run streamline.js gives error "The system cannot find the path specified"

I ran npm install streamline -g as it specifies in the github doc
However, when I ran _node on windows command line....I got:
The system cannot find the path specified.
I checked my AppData\Roaming\npm (where node modules are installed, and I verified that this path is indeed in my environment variables), I can see that _node.cmd just lies there along with bower, but I have no problem invoking bower from windows command line
I think windows knows that I have "_node.cmd", since before the installation, the error message I am getting is:
'_node' is not recognized as an internal or external command
So I suspect that the underscore somehow broke windows command line, anyone knows how to fix this issue?

npm not installing returns error consistently

I was trying to install this : Search git whodotheyserve. com but this error shows up consistently .No matter what i try. I have tried other version of npm they are installed but the
npm test
error shows up .
npm run-script task
too returns error
This happens consistently .Also i am following each step mentioned in source of this project.Image attached.Please help where am i wrong here. The file extension used here ls .I had no experience with these. Image link
Echo %PATH% image link
The build fails because you are using Windows instead of Linux.
This is clearly stated in the installation instructions you claim to have followed in your duplicate question.
notes
The build tasks rely on Linux shell commands such as pkill and rsync
so are unlikely to run on other OS's without some tweaks.
If you want to run this under windows, you should ask the repo maintainer for guidance.
You have to install python 2.7 and make sure it's in your PATH variable.
Try:
set PATH=%PATH%;C:\python2.7\python.exe
Replace C:\python2.7\python.exe with your actual python installation path
The issue here was that this was made to run on linux only.So ,it won't run on windows on which i was trying to run it.The issue arose as i was trying to install it on wrong OS.I have successfully installed it on linux.It works great.
I want to thank all those who contributed in helping me with this issue.Thanks a lot to all those who helped.

beefy command not found

I am new to node.js and trying to follow this tutorial. I am getting an error on the last command beefy game.js:bundle.js --live. It says sh.exe": beefy: command not found
The beefy package version I am using is 2.1.1
Tried to Google this problem but couldn't find a solution.
I have not followed the tutorial in detail, but the response form the console means that the the console command or program called beefy is not installed. The first word of your input into the console will be interpreted to be a command (a little program) that will run.
For instance cd is a program to change directory and the next thing you enter will specify a directory to which to change.
beefy is not a command/console program that is in your system. (It is not a standard command.) Probably somewhere else in the tutorial you were instructed to install it in one of your various bin/ directories (where shell program commands are stored.)
EDIT:
TL;DR
The fix: install beefy globally (on your machine not for directory only) using npm:
npm install beefy --global

Categories