Dart-Sass not being added to PATH - sass

So, I've downloaded the .zip 1.32.11 Windows x64 release from the Dart-Sass's Github repo and extracted it to the Program Files folder. Using the steps provided, I found Path under System variables in Step 4. There was no PATH there, the closest thing was PATHTEXT and Path. My first question: Can I use Path or I have to create a new System variable called PATH. Thinking Path was sufficient, I decided to edit the System variable and then press Browse to search for the Dart-Sass folder. After this was done, I went to Command Prompt and typed sass -version. The result was that Sass was not recognized. Did I do anything wrong? If so, what can I do to fix it?

I'm noticing two things about your problem. The first is your path variable... did you make sure to change Me to your username in the PATH variable?. The second encompasses your installation. Can you find the dart *.exe file? If not, try uninstalling and reinstalling, making sure each step is completed word for word.

Related

Visual Studio Code Removing Items from System Path?

I am opening a project in Visual Studio Code and it can't find npm, in spite of NPM being in my system path.
If I open a command prompt or a powershell prompt, and I type env I See it in my path. If I open a terminal in VS:Code and type env it omits both: /d/nodejs and /c/Program Files/Azure Data Studio/bin from the list of items in my path.
I have tried rearranging all of my paths in my Windows Environment Variable editor dialog, and no matter the order, only these two items are missing. So, I have validated that it is not other paths that could be causing issues in some sort of path parsing code.
Why would Visual Studio Code alter my path environment variable, removing node and its own path from the environment variable list?
If I move these items from my system path to my user path, it is able to find them but there are some other subtle issues with things not being found I haven't been able to figure out yet.
Note: These are the ONLY two items being removed. And they are ONLY removed in VS:Code.
Even though there is other weirdness with moving the path to my user path from my system path, that was able to be worked around. So, my answer is: Move your nodejs path from your system path in Windows to your user path in Windows.

Find out where bash command definition is stored?

I used make/cmake for a project a while ago to build a command line tool, and I thought the binary was only executable while in that directory, but I just found out I'm able to call the command from any directory. This is troublesome because I'm having trouble building a newer project and I suspect this is related.
For example, I can run the command caffe train from a specific folder where I built the binary, but it turns out I can run caffe train from any folder, which I shouldn't be able to do. I could delete the binary, but the problem is that the command for it is stored and being called from somewhere, but I don't know where.
How can I find out where the definition for this command is stored? I examined my .bash_profile and looked at all the paths it listed, but I'm not seeing a relevant one. Is there another place I ought to be looking to find where command line tools are installed?
Ah sorry I just found out: Using type command gives where it is stored. Apparently whereis command should also do the same thing, though it gives me no output; for anyone else who has this problem, trying both would be good!

How to know the location of lualatex.exe?

The TexLive system uses lualatex. I have an application that needs to know the location of lualatex.exe.
Now, if lualatex is in the PATH evnvironmental variable, I'm in luck. If it isn't there, then I have to go and do a full-computer file-search for the file.
Is there another way I could find it?
I mean, is there some lualatex registry value or directory that is standard in every installation?
[update]
Okay, I have found a certain standard; if TexLive is installed, in the %userprofile% directory, there will be directories for .texlive2012 or .texlive2013 - I wonder if there is a way to use that knowledge to find the installation directory. The contents of those folders do not reveal anything, however.
It depends on what LaTeX installation you are using. If it's MikTeX (under 64 bit Windows) it will be in
C:\Program Files\MiKTeX 2.9\miktex\bin\x64\
So I think it will always be in "the bin folder".

Don't get GraphViz and phpDocumentor to work

I'm trying to create a php documentation on my local XAMPP host (on Windows 7) with phpDocumentor.phar (v2.). It gives me (after parsing all the files) this error:
Unable to find the dot command of the GraphViz package. Is GraphViz correctly installed and present in your path?
I searched a lot, but nothing helps. What does 'path' means? If I open a command box at any location I can start the dot.exe (which gives me no output but waiting prompt). In my environment path variable the bin folders is added. GraphViz is installed correct in Program Files and runs standalone.
What could I do or check?
In order to get GraphViz running properly with a Windows based phpdoc installation, just put the GraphViz program directory (c:\some\path\graphviz\release\bin) to the Windows Path system variable.
In order to do this, follow these steps (Win7, please provide your OS version if this doesn't apply to your situation):
From the desktop, right-click My Computer and click Properties.
In the System Properties window, click on the Advanced tab.
In the Advanced section, click the Environment Variables button.
In the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button.
Different directories are separated with a semicolon:
C:\Program Files;C:\Winnt;C:\Winnt\System32
It will most likely look a bit different in your enviroment, so please just take this for an example. Just add the GraphViz Path at the end like this:
C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\somefolder\graphviz\release\bin
I'm not too sure if you have to reboot your system after changing this value. You had to do this in the old days of Win2k, and I just don't know if this still applies to modern Windows versions. It surely doesn't hurt!
After this, phpdoc should be able to find the dot command.
The steps to resolve this error are:
download Windows Packages from
https://graphviz.gitlab.io/_pages/Download/Download_windows.html
Just install it
add c:\Program Files\Graphviz*\dot.exe or c:\Program Files (x86)\Graphviz*\dot.exe to your environment variable PATH
run phpdoc
Re-start your machine & run phpdoc (if still shows the same error message)

where is $PATH set in xcode?

It looks like xcode's $PATH environment setting is different from my user shell environment.
Where does xcode get the $PATH setting from and what's the best way to append to the search path?
if you're writing a Run Shell Script build phase, you can just do:
PATH=${PATH}:/opt/local/bin
or whatever inside the script content.
There's some confusion in these answers, as some of them are trying to solve the $PATH for the built executable being run by Xcode. But the question is about Xcode, implying that it's about the build process itself.
For example, in a Build Phase Run Script step that runs an executable installed by Homebrew. It's not a good idea to hard-code the build process to include a path that is specific to one build machine (New macOS versions come out, new developers join the team, etc.)
The problem has multiple layers:
Changing $PATH in bashrc/zshrc/profile takes effect on shell sessions, but not in macOS applications
To solve this, you can set the PATH for applications using:
sudo launchctl config user path $PATH
You will then need to restart your machine for the change to take effect. You will need to run this again if you change your $PATH.
(This came from a comment on GitHub.)
Xcode by default does not use the system $PATH, and replaces it with its own sanitized value
This is solved by changing a User Default. This probably has some risk, since Xcode does this sanitization to ensure that its own build tools are used, and if you have executables with the same name in other places, they might be run instead. Caveat emptor!
defaults write com.apple.dt.Xcode UseSanitizedBuildSystemEnvironment -bool NO
And it looks like this gets reset on every restart of macOS, so be prepared to issue this command every time you restart.
(This part came from this answer.)
The easiest solution is to add the PATH variable in Xcode.
PATH=${PATH}:/usr/local/bin
This applies for OSX 10.7 and earlier ONLY.
XCode gets its environment variables the same way as other OS X processes, from ~/.MacOSX/environment.plist.
Check developer.apple.com/qa/qa2001/qa1067.html for details on how to set things.
In Xcode 5 you can add your PATH as a variable to either a target or the project settings.
Add a custom variable with the +sign on the top of the page
Edit the name of the variable to be PATH and add your preferred value (e.g. /usr/local/bin for a default install of homebrew.
If you are talking specifically about the executable search path environment variable named PATH, then there are a few places that it is set:
In your shell settings if it is a command line tool. Depending on your shell, this could be ~/.cshrc, ~/.profile, ~/.bash_profile, etc.
In the environment.plist file that was mentioned earlier.
If you are in a debugger, then it is whatever gdb uses. I believe that gdb will read commands from ~/.gdbinit if it exists.
XCode lets you set environment variables within the Info page for executables.
This is an update for later versions of macOS and Xcode as things have altered. This is with Xcode 11.0 and macOS 10.14
The biggest issue is that ~/.MacOSX/environment.plist does not get read now.
Build Settings
This means that if in the build you need the PATH set, e.g. for external builds and they run executables there is no simple solution. /etc/paths does not seem to be read either.
The solution is as in #GhostLyrics answer to add the PATH variable in Build Settings. However as noted in comments Xcode will not just use that value but it puts its own values before that. Also it does a straight textual substitution and so you need to also add the separator that PATH uses i.e. the : (colon). The value I have added is :opt/local/bin I also found that you can only do this for a target and not at the project level.
Run Shell Script
This is the simple case as in this answer
PATH=${PATH}:/opt/local/bin
or whatever inside the script content.
Alternatively put this change in your non login shell starter file e.g. ~/.bashrc ~/.zshrc
Running the executable
This is done in the Schema in the Run portion.
Set PATH in the environment variables as stated in answers here. Note I have not tried this and I am not certain how much of the PATH needs setting.
Xcode doesn't look at your shell path environment.
Have a look at NSProcessInfo; and do an NSLog to see what comes up.
If you want a path to apply to all graphical programs you need to set up the ~/.MacOSX/environment.plist. as described.
The recommended way to set the environmen variables are actually in /etc/paths and etc/paths.d although these are also not picked up by Xcode.
I asked about this here.
Nothing was working for me in XCode 7.
You need to set the PATH variable in XCode schemes.
Found the solution at:
Where to set environment variables for app?
Try opening your xcode project from the terminal, this worked for me: open some.xcodeproj
Instead of opening xcode and then loading the project or double clicking on it.
I know... silly

Resources