Today I started to work with bower in my project in Visual Studio 2013. When I tried to run bower init from the Package Manager Console in VS, I got the following error:
PM> bower init
bower.cmd : bower ENOINT Register requires an interactive shellIn Zeile:1
Zeichen:1
+ bower init
+ ~~~~~~~~~~
+ CategoryInfo : NotSpecified: (bower ENOINT ...teractive shell:St
ring) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Additional error details:
Note that you can manually force an interactive shell with --config.interactive
Apparently the command needs an interactive shell to ask the user about some setting preferences, so I ended up running it outside of VS in Powershell (which is not really great).
The Package Manager Console only seems to provide non-interactive functionality (in the style of "fire and forget"). I searched for a plugin for VS that provides an interactive shell, but had no success.
Is there any interactive shell available that integrates with Visual Studio, allowing you to run an interactive script like bower init without having to leave the IDE?
Related
terraform : The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
terraform init
+ CategoryInfo : ObjectNotFound: (terraform:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
You can refer this link.
Install Terraform
Install Terraform Visual Studio Code extension
Or you can try using Linux WSL for windows.
If you have downloaded it in the windows system then try to login with the administrator on visual code and it should work.
I can’t install Visual Studio Build tools.
when i want to launch the installation, a window appears telling me: writing impossible on the specified device.
I checked the logs and saw that there was an Error 0x8007001d
Also, I ran the installation with the command lines, I was able to download the files but then, when I run the command :
vs_buildtools.exe --noweb
It opens visual studio installer and I get the same Error 0x8007001d
You should know that without passing the command lines : vs_buildtools --layout d:\localVSlayout --lang fr-FR, I can’t download the packages in Visual Studio Installer
Have a good day
I'd like to force NuGet to restore my NuGet packages. Going to my solutions directory and type NuGet restore, even with the latest downloaded NuGet.exe doesn't work.
As explained here, I can do this in a Powershell prompt, using the Update-Package command (as I prefer not to use my Visual Studio environment).
However, my Powershell seems not to understand Update-Package, although I have a +5 version:
PowerShell Prompt> Get-Host | Select-Object Version
Version
-------
5.1.19041.1023
PowerShell Prompt> Update-Package -reinstall
Update-Package : The term 'Update-Package' is not recognized as the name of a cmdlet, function,
script file, or operable program.
Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
+ Update-Package -reinstall
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Update-Package:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
What can I do in order to launch Update-Package successfully in my Powershell?
Thanks in advance
Mybe you can try Update-Package -reinstall command in Package Manager Console
Standard powershell doesn't ship have NuGet restore functionality.
If you refer to https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio, and https://learn.microsoft.com/en-us/nuget/consume-packages/package-restore, you will see that there are 5 ways to use NuGet.
Visual Studio (and MSBuild.exe)
Visual Studio for Mac
dotnet CLI
NuGet.exe CLI
Package Manager Console (in Visual Studio)
There is no functionality built into powershell.
Your only options are to build on top of the above mentioned tooling.
Call dotnet.exe restore
Call nuget.exe restore
Call msbuild.exe restore.
I don't use Update-Package, but the following:
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" /t:restore C:\code\projectdirectory
You may have to change the path to MSBuild.exe
Not native PowerShell, but it works.
As titled, using Powershell after executing
PS C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build> .\vcvarsall.bat amd64
then programs like cl, nmake or msbuild should be available on the path, but they are not
PS C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build> cl
cl : The term 'cl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
cl
~~
CategoryInfo : ObjectNotFound: (cl:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException
Specs:
VS 2019 Community Edition with the "Desktop development with C++" workload:
MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.28)
Windows 10 SDK (10.0.18362.0)
Just-In-Time debugger
C++ profiling tools
C++ CMake tools for Windows
C++ ATL for latest v142 build tools (x86 & x64)
Test Adapter for Boost.Test
Test Adapter for Google Test
Live Share
C++ AddressSanitizer (Experimental)
Win10 Pro N x64, 20H2, 19042.746
What am I missing?
Powershell executes the batch file in a child cmd process. The VS environment is set in that cmd process, then gets discarded when the process ends and control returns to Powershell.
The straightforward solution is to reverse the sequence, and set the VS environment before starting the Powershell session so that PS inherits it. Assuming a usual VS installation with the correct VS160COMNTOOLS environment variable set, this can be done by running the following at either a command prompt, via Start / Run, or from PS itself.
cmd /c ""%VS160COMNTOOLS%\..\..\VC\Auxiliary\Build\vcVarsAll.bat" amd64 && start powershell"
See also In a CMD batch file, can I determine if it was run from powershell? and How can I use PowerShell with the Visual Studio Command Prompt? for more discussion and possible alternatives - both for returning environment variables from batch files to PS in general, and for the VS environment in particular.
I am trying to use bower inside Visual Studio 2013.
First I installed bower (not bower.js) via nuget's Package Manager Console.
Then I thought I could simply type
PM> bower init
inside the PMC to generate the bower.json.
But then it gave me this error.
bower : The term 'bower' is not recognized...
PS. The path of the PM> is pointing to C:\MyWebProject\MyWebProject\.bin.
What am I missing here??
Open the command prompt
Navigate to web project folder
Run bower init
You should have bower.json created by answering all answers on the cmd prompt.
Srinivas accurately described the steps needed to get you started with a bower.json in your root folder, which is where you want to start. You now have two main tasks:
Define dependencies - use Package Intellisense.
Install dependencies - use Grunt Launcher. They will be installed to the bower_components folder.
Reference dependencies - simply add them to you project (as links).
For more information see Introducing Gulp, Grunt, Bower, and npm support for Visual Studio.
Note that Visual Studio 2015 (currently in preview) has built-in, first-class support for all of the above: Manage Client-Side Web Development in Visual Studio 2015, Using Grunt and Bower.