In VS2015, opening a web project/solution that uses node packages (e.g. gulpfile.js) will cause VS to automatically run "npm install" and install all the packages. VS2015 comes with an old version of npm (1.4.19), which doesn't do a "flat" install of package dependencies, which causes paths to get created that are over 260 characters. This is really painful when it happens every time Visual Studio is opened. I've found several workarounds (including http://jameschambers.com/2015/09/upgrading-npm-in-visual-studio-2015/), but ideally there would be a setting somewhere to disable "auto npm install" or something like that, I just either can't find the setting or it doesn't exist.
You can literally "hide" all web tools from Visual Studio:
Under Tools menu select "Options..."
Go to "Projects and Solutions" -> "External Web Tools"
If you want to make Visual Studio use your globally installed npm - just remove checkboxes from all items starting with $(DevEnvDir).
If you want to completely disable all web tools in VS: uncheck all.
Related
I click IDEA.64 and there is no response. However, when I click idea.pat, it could launch. I am very confused. I tried to uninstall and install again, but it doesn't work. Also, my Clion has the same issue.
The answer from JB's community by Konstantin Annikov :
'Please install https://aka.ms/vs/16/release/vc_redist.x64.exe. The root cause is that vcruntime140.dll from Visual C++ Redistributable package failed to load. It is one of jbr\bin\awt.dll dependencies. Visual Studio makes changes to C++ tools sometimes and we are working on including this dll into IDE installation, or exclude its functionality.C++ tools are needed to run IntelliJ IDEA'
Using the latest VS update 16.7.4 but happened also on .3 and .2. Working on a Xamarin.Forms project when I first started noticing it, but now it happens on any project when I try to go to the menu and click [Manage Nuget Packages for the Solution].
NPM shows up fine. If I stay on the installed or updates tab it works fine. But when I click the BROWSE tab it shows a list of the latest searches, and then after about 3 seconds the cursor pops up, then vs becomes un responsive and it crashes.
I don't know much about looking at the vs logs to find out what is going on. I happens on every project now, so I don't think removing the .vs or .obj folders have anything to do with it, although I tried it on the Xamarin Project to no avail.
Anyone else seen this?
Nuget PM crashes VS 2019
1) First, disable any other VS installed Extensions under Extensions-->Manage Extensions to check whether a vs extension caused that.
2) clean all nuget caches
3) reset all vs settings under Tools-->Import and Export Settings-->Reset All VS Settings
4) close VS Instance, delete the global nuget.config file under C:\Users\Administrator\AppData\Roaming\NuGet then reopen VS to regenerate that file.
5) check under Tools-->Options-->Nuget Package Manager-->Package Sources
try to use https://www.nuget.org/api/v2/ or http://packages.nuget.org/v1/FeedService.svc/ as nuget.org source.
Also, uncheck other package source and only remain the nuget.org package source.
6) delete bin and obj folder of the project to do a clean step. Also, you can try to install one package on the new project to test whether the issue happens again.
7) try to repair VS and it works as the final step.
I'm trying to run ESLint on Visual Studio 2019. It works fine until I add eslint-plugin-prettier in my package.json. Then I get this error.
internal-error | (ESLint) Failed to load plugin prettier: Cannot find module 'eslint-plugin-prettier'
If I open the command prompt I can run eslint and it has no trouble finding the prettier plugin.
My next step is to go into the ESLint source code, find that error, and figure out where it's looking for "eslint-plugin-prettier". But I can't figure out what copy of ESLint Visual Studio is running. It works even if I uninstall ESLint both locally and globally, so I guess it's running an internal copy?
Is there a way to find out for sure what copy of ESLint Visual Studio is running?
I also wanted to find this information, and here is what I did:
Go to C:\Users\\{YourWindowsUsername}\AppData\Local\Microsoft\TypeScript\ESLint.
Open the package.json file.
You should see the version of ESLint that is installed, in my case it is "eslint": "4.19.1" for example.
Having moved from bower to npm in an ASP.Net Core MVC project that is under TFVC source control I now have an additional solution appearing in Team Explorer in Visual Studio 2017 that is in my node_modules folder:
.\node_modules\node-sass\src\libsass\win\libsass.sln
How can I stop this solution appearing in Team Explorer? node_modules is already in my .tfignore file and that folder/solution is not in source control.
This can be done by simply hiding the node_modules folder.
I saw this as a side-effect when I was following instructions here, hiding the folder reduces the load times and memory footprint for Visual Studio as it doesn't try and preparse all the modules.
As an alternative and a lighter touch #kakusan pointed out that only the solution file needs to be hidden. Be aware that this change may not be kept if NPM for some reason replaces the file.
Historically, this has been done with the Microsoft Build Tools. But it seems that the Build Tools may not be available for versions after 2015. The replacement appears to be the Visual Studio build tools, which doesn't seem to have a real homepage yet.
I downloaded the VS2017 Professional installer, and went to the Individual Components tab. Right away, the summary is telling me that the Visual Studio core editor is there, taking up 753MB. I don't want the editor. Just msbuild. There is no way to unselect the editor.
Is there a way I can install the latest version of msbuild without also installing the Visual Studio IDE?
The Visual Studio Build tools are a different download than the IDE. They appear to be a pretty small subset, and they're called Build Tools for Visual Studio 2019 (download).
You can use the GUI to do the installation, or you can script the installation of msbuild:
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.MSBuildTools --quiet
Microsoft.VisualStudio.Workload.MSBuildTools is a "wrapper" ID for the three subcomponents you need:
Microsoft.Component.MSBuild
Microsoft.VisualStudio.Component.CoreBuildTools
Microsoft.VisualStudio.Component.Roslyn.Compiler
You can find documentation about the other available CLI switches here.
The build tools installation is much quicker than the full IDE. In my test, it took 5-10 seconds. With --quiet there is no progress indicator other than a brief cursor change. If the installation was successful, you should be able to see the build tools in %programfiles(x86)%\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin.
If you don't see them there, try running without --quiet to see any error messages that may occur during installation.
For MsBuild 17, which is part of VS2022, you need to download the Build tools for VS2022 here (which is actually just the installer):
https://aka.ms/vs/17/release/vs_BuildTools.exe
(This link can be found by going to https://visualstudio.microsoft.com/downloads and scrolling all the way down to "Build Tools for Visual Studio 2022".)
Once downloaded you can install by typing:
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.MSBuildTools --quiet --wait
Depending on your needs you might also need to specify --includeRecommended and possibly --includeOptional.
If you are doing web development you probably also want to add --add Microsoft.VisualStudio.Workload.WebBuildTools.
Input parameters and return codes are available here:
https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2022