6

Today I upgraded to Visual Studio 2015 Update 2 including TACO Update 8. When I try to build, it fails. In the detailed error log, I see (beside others):

Installing npm 2.14.9. This could take a few minutes... Failed : The remote server returned an error : (407) Proxy Authentication Required.

I assume this happens since TACO is now detecting the proxy by itself, but for the credentials this is not possible. Therefore I disabled the automatic proxy detection as well as the sandboxed version of NodeJS. Additionally I cleared the Cordova cache.

But the build is still failing. The strange thing is it is still trying to install npm 2.14.9. I get now:

Failed: The specified path, file name, or bot are too long. The fully qualified name must be less than 260 characters, and the directory name must be less than 248 characters,

I assume this happens my %APPDATA% directory is part of a roaming profile placed on a network share. Therefore the content of the APPDATA variable has a length of 82 characters.

Therefore I am using with npm in general the prefix c:\npm, which is working perfect. But unfortunately, TACO ignores it...

So my questions are:

  • Can I specify the NPM prefix also for TACO?
  • Can I avoid to install NPM 2.14.9 (which was my expected behaviour after un-checking the 2 options)?

And finally:

  • It would be great if I could enter also the proxy credentials somewhere.
Markus Wagner
  • 708
  • 3
  • 13
  • I think it tries to install the NPM is because Visual Studio is trying to use a sandboxed version of NodeJS to avoid version conflict issues. Go to the setting window where you clear the Cordova Cache, there is a check box "Use a sandboxed version of NodeJS". Uncheck it and see if you can start to build your code. Also try to add your npm path to system Path environment variables. It's only a workaround. I will check with VS team to see if there is any option to make it easy to configure. – Alan Yao - MSFT Apr 19 '16 at 08:13
  • I am running into the same issue, unchecking the box does not fix the issue. – naturallyfoster May 13 '16 at 17:07
  • Clarification: Unchecking the "Use a sandboxed version of NodeJS" box does not fix the issue. It still tries to install NPM 2.14.9 – naturallyfoster May 13 '16 at 17:41
  • I have the same problem. What I can't understand is that my global npm version is 2.14.9 and yet it still tries to install it. It doesn't matter if the sandbox checkbox is ticked or not. – jfl May 16 '16 at 15:20
  • Ok, so it seems to be a general problem with NodeJS 2.14.9 on Windows. I believe the issues has been resolved in later versions of NodeJS, so now the question is how to get VS to try and install a different version for the sandbox, seeing that the sandbox checkbox doesn't work. I found places where the sandboxNpmVersion is set, but even changing that doesn't work. It is here: – jfl May 20 '16 at 06:34
  • C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\Packages\vs-tac\install.js(22):var sandboxNpmVersion = '2.14.9'; C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\Packages\vs-tac\lib\util.js(25):var sandboxNpmVersion = '2.14.9'; – jfl May 20 '16 at 06:35
  • Did you find a solution? – d0001 Jun 17 '16 at 17:41
  • YES!! I finally found the solution. Turns out the path that was causing the issue was in"C:\Users\my_very_very_very_very_long_username\AppData" – jfl Jul 21 '16 at 12:31

2 Answers2

0

YES!! I finally found the solution. Turns out the path that was causing the issue was in: "C:\Users\my_very_very_very_very_long_username\AppData"

So I fixed it by moving my AppData folder according to this article: http://www.tweaklibrary.com/System/Application-Path/71/Change-default-location-of-the-%E2%80%9CApplication-Data%E2%80%9D-folder/10471/

Rebooted and after that it worked.

jfl
  • 451
  • 3
  • 7
0

Go to the setting window where you clear the Cordova Cache, there is a check box "Use a sandboxed version of NodeJS". Uncheck it and see if you can start to build your code. Also try to add your npm path to system Path environment variables. It's only a workaround.