Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Typings Acquisition not working #1415

Closed
pkunze opened this issue Nov 10, 2016 · 5 comments
Closed

Automatic Typings Acquisition not working #1415

pkunze opened this issue Nov 10, 2016 · 5 comments
Labels

Comments

@pkunze
Copy link

pkunze commented Nov 10, 2016

Expected Behavior

When I add a package to a JS-Project, I expect NTVS to create a Typings folder and to download the Definition files.

Actual Behavior

I just can't seem to get this to work. No matter if it is within an existing Project, or a brand new one.

  • NTVS Version: 1.2.40726.00
  • Visual Studio Version: Microsoft Visual Studio Enterprise 2015 Version 14.0.25431.01 Update 3
  • Node.js Version: 6.7.0
  • I have set everything as described in the corresponding Wiki page.
Steps to Reproduce
  1. Create a new JS Project (not TS)
  2. npm install express
  3. No Typings installed

Are there any additional Steps required? Could it be a matter of a corporate Proxy-Server within the Company I work at?

@mjbvz
Copy link
Contributor

mjbvz commented Nov 10, 2016

As long as you have ES6 IntelliSense enabled (found under Tools -> Options then Text Editor -> Node.js -> IntelliSense) and have not disabled automatic typings acquisition, the typings for express should be automatically downloaded.

Can you try reproducing this again and check the npm section of the Output Window in visual studio? It should log if automatic typings acquisition was attempted and if it failed for some reason. The proxy could very well be causing issues here.

@pkunze
Copy link
Author

pkunze commented Nov 11, 2016

Sure, see the output below:

I just did the following:

  1. Made sure ES6 IntelliSense is enabled
  2. Made sure automatic typings acquisition is enabled
  3. Created new JS Project
  4. Installed express

====Executing command 'npm install express --save '====

[email protected] C:\Users\pkunze\Documents\Visual Studio 2015\Projects\TestSolution\TypingsAquisitionTest
npm WARN [email protected] No repository field.
-- [email protected] npm WARN [email protected] No license field. +-- [email protected] | +-- [email protected] | |-- [email protected]
| -- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| -- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| -- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| -- [email protected] +-- [email protected] +-- [email protected] |-- [email protected]
+-- [email protected]
`-- [email protected]

====npm command completed with exit code 0====

Could not acquire typings for 'node'
Successfully installed typing files for Intellisense.
(node:12528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): PopsicleError: Unable to connect to "https://api.typings.org/entries/dt/node/versions/latest"
Caused by: Error: connect ECONNREFUSED 104.24.113.177:443
(node:12528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): PopsicleError: Unable to connect to "https://api.typings.org/entries/dt/express/versions/latest"
Caused by: Error: connect ECONNREFUSED 104.24.113.177:443
(node:12528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): PopsicleError: Unable to connect to "https://api.typings.org/entries/dt/node/versions/latest"
Caused by: Error: connect ECONNREFUSED 104.24.113.177:443
(node:12528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): PopsicleError: Unable to connect to "https://api.typings.org/entries/dt/express/versions/latest"
Caused by: Error: connect ECONNREFUSED 104.24.113.177:443
(node:12528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): PopsicleError: Unable to connect to "https://api.typings.org/entries/dt/express/versions/latest"
Caused by: Error: connect ECONNREFUSED 104.24.113.177:443
(node:12528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): PopsicleError: Unable to connect to "https://api.typings.org/entries/dt/node/versions/latest"
Caused by: Error: connect ECONNREFUSED 104.24.113.177:443

@pkunze
Copy link
Author

pkunze commented Nov 11, 2016

I am suspecting the Proxy-Server of my company btw. However, placing an .typingsrc-file in the project

{
    "proxy": "http://proxy.mycompany.com:8080",
    "rejectUnauthorized": false
}

leads to another output:

====npm command completed with exit code 0====

undefined:1
{
^
SyntaxError: Unexpected token  in JSON at position 0
at Object.parse (native)
at exports.parse (C:\Users\pkunze\AppData\Local\Microsoft\Node.js Tools\ExternalTools\node_modules\rc\lib\utils.js:15:17)
at addConfigFile (C:\Users\pkunze\AppData\Local\Microsoft\Node.js Tools\ExternalTools\node_modules\rc\index.js:31:20)
at module.exports (C:\Users\pkunze\AppData\Local\Microsoft\Node.js Tools\ExternalTools\node_modules\rc\index.js:45:3)
at Object. (C:\Users\pkunze\AppData\Local\Microsoft\Node.js Tools\ExternalTools\node_modules\typings-core\dist\utils\rc.js:11:44)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
An error occurred installing typings used for IntelliSense.

@mjbvz
Copy link
Contributor

mjbvz commented Nov 11, 2016

Yes, it looks like the proxy is causing issues. Try changing the .typingsrc file to:

proxy="http://proxy.mycompany.com:8080"
rejectUnauthorized=false

as per typings/typings#120 (comment) (there are some other suggestions in that thread that you can try as well)

@pkunze
Copy link
Author

pkunze commented Nov 14, 2016

Perfect, works like a charm!

@pkunze pkunze closed this as completed Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants