Имя nuget не распознано как имя командлета
Перейти к содержимому

Имя nuget не распознано как имя командлета

  • автор:

 

The term 'nuget' is not recognized

Trying to run any nuget command from PM Console and I get this error.

nuget : The term ‘nuget’ 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 + nuget update -self

What should the path be, when I run this command?

and based on the answer, I copied the nuget.exe to the folder and set path. After doing that, I am still getting the same error.

1 Answer 1

NuGet command from PM Console is different with NuGet.exe CLI Reference. The command ‘nuget’ does not supported by the PM Console. Please check whether your NuGet command is correct first. Besides, you can try to use other command from PM Console to verify this issue:

If all command are not recognized, please check and update your Windows version. In the version 1511, you need to have been updated to .64 or later of the builds. otherwise you run into a powershell bug.

Then update the NuGet VSIX ,

Open Visual Studio -> Tools -> Extensions and Update -> Updates,

Update Nuget Package Manager for Visual Studio 2013/2015 (note that: Restart your visual studio after update).

Термин "нугет" не признается

Попытка запускать любую команду nuget из PM Console, и я получаю эту ошибку.

nuget: термин ‘nuget’ не распознается как имя командлета, функция, файл script или операционная программа. Проверьте правильность написания имя, или если путь был включен, убедитесь, что путь правильный и попробуй еще раз. По строке: 1 char: 1 + nuget update -self

Каким должен быть путь, когда я запускаю эту команду?

и на основании ответа я скопировал nuget.exe в папку и установил путь. После этого я все равно получаю ту же ошибку.

Команда NuGet из Консоль PM отличается от NuGet.exe CLI Reference. Команда «nuget» не поддерживается консолью PM. Проверьте, правильна ли ваша команда NuGet.
Кроме того, вы можете попробовать использовать другую команду из консоли PM для проверки этой проблемы:

Если вся команда не распознана, проверьте и обновите версию Windows. В версии 1511 вам необходимо обновить до .64 или новее сборки. иначе вы столкнетесь с ошибкой powershell.

Затем обновите NuGet VSIX ,

Откройте Visual Studio → Инструменты → Расширения и обновления → Обновления,

Обновить Nuget Package Manager for Visual Studio 2013/2015 (обратите внимание, что: после обновления обновите свою визуальную студию).

«nuget» не распознается, но другие команды nuget работают

Я пытаюсь создать пакет nuget, используя http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory в качестве ссылки. Моя консоль диспетчера пакетов в Visual Studio не позволяет мне использовать команду «nuget». Я могу «Get-help nuguet», и он отображает:

 

Включены следующие командлеты NuGet.

  • Однако всякий раз, когда я запускаю команды с помощью nuget, это дает:

Термин «nuget» не распознается как имя командлета, функции, файла сценария или исполняемой программы. Проверьте правильность написания имени или, если был указан путь, убедитесь, что путь указан правильно, и повторите попытку.

В строке: 1 символ: 6 + nuget <<<< + CategoryInfo: ObjectNotFound: (nuget:String) [], CommandNotFoundException + FullyQualifiedErrorId: CommandNotFoundException

Я пробовал следующие решения:

1>закрытие всех элементов и перезапуск

2> удаление и переустановка

3> создание файла профиля powershell (ранее этого не было, и это фактически все сломало)

Проблема начала появляться после того, как я обновил пробную версию Visual Studio 2012 Ultimate до зарегистрированной. Изначально у меня был установлен VS 12 Pro. Я не знаю, имеет ли это какое-то отношение к этому, но я заметил, что у других, у которых были подобные проблемы, были установлены версии 10 и 12.

Мой вопрос: «Кто-нибудь знает, что еще попробовать?» Моя теория заключается в том, что путь к команде nuget отсутствует, но я не могу найти, как настроить пути, которые использует консоль диспетчера пакетов, и я не уверен, где на самом деле хранится командлет nuget.

Обновлено — попытался загрузить инструмент командной строки, как предложено ниже. Это приводит к тому, что ничего не работает снова. Я попытался удалить, и теперь у меня есть элемент в расширениях vs2010 для nuget, для которого не включена кнопка установки или удаления. Это наводит меня на мысль, что это связано с расширениями, установленными через 2010 и 2012 годы, которые играют роль в моей маленькой драме. Если кто-то также знает, как удалить удаляемое расширение, пожалуйста, сообщите, но я попробую другой вопрос для этого.

'nuget' is not recognized but other nuget commands working

I am trying to create a nuget package using http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory as a reference. My Package Manger Console in Visual Studio is not allowing me to use the ‘nuget’ command. I am able to ‘Get-help nuguet’ and it displays:

The following NuGet cmdlets are included.

  • However, whenever I start off commands with nuget is gives :

The term ‘nuget’ 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 ag ain.

At line:1 char:6 + nuget <<<< + CategoryInfo : ObjectNotFound: (nuget:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

I have tried the following solutions:

1>closing down all items and restarting

2> uninstalling and reinstalling

3>creating a powershell profile file (this didn’t exist before and this actually broke everything)

The problem started to appear after I upgraded my Visual Studio 2012 Ultimate trial version to registered. I had originally had the VS 12 Pro installed. I don’t know if that really has anything to do with it but I noticed that others that had similar problems have vs 10 and 12 installed.

My question is «does anyone know what else to try?» My theory is that the path to the nuget command is missing but I cannot find how to configure the paths the package manager console uses and I am not sure where the cmdlet nuget is actually stored.

Updated—tried downloading the command line tool as suggested below. This lead to nothing working again. I tried to uninstall and now I have a item in vs2010 extentions for nuget that doesn’t have a install or unistall button enabled. This leads me to believe that it has to do with extensions installed via 2010 and 2012 that has a part in my little drama. If anyone also knows how to nuke an uninstallable extension, please advise also but I will try another question for that.

 

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *