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 Type Acquisition in VSCode on Ubuntu 14.04 #34191

Closed
intoCL opened this issue Sep 12, 2017 · 5 comments
Closed

Automatic Type Acquisition in VSCode on Ubuntu 14.04 #34191

intoCL opened this issue Sep 12, 2017 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues

Comments

@intoCL
Copy link

intoCL commented Sep 12, 2017

As posted here

  • VSCode Version: 1.16.0
  • OS Version: Ubuntu 14.04 LTS
  • installed nodejs and npm using apt-get with nodejs and npm packages respectively
  • set "typescript.npm": "/usr/bin/npm"

Steps to Reproduce:

  1. Create test project directory vscodetest
  2. cd into vscodetest
  3. open vscode using vscode . from terminal
  4. add new JavaScript file app.js
  5. add jsconfig.json with the following configuration
{
    "typeAcquisition": {
        "include": [
            "jquery"
        ]
    }
}
  1. In app.js start typing the following...
    var f = $('sdsf').

When I hit '.', Intellisense just gives me '$' and 'f'.

Also tried adding package.json with

{
    "dependencies": {
    "jquery": "^3.2.1"
    }
}
@vscodebot vscodebot bot added the javascript JavaScript support issues label Sep 12, 2017
@mjbvz mjbvz added the info-needed Issue requires more information from poster label Sep 15, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Sep 15, 2017

To help investigate, please:

  1. Set "typescript.tsserver.log": "verbose" in your user settings
  2. Restart VSCode and open the js file again
  3. Wait 10 seconds or so
  4. Run the TypeScript: Open TS Server Log command in VSCode
  5. This should open a folder with a file called ti-xxx.log That file has info about typings installation

Can you please share this log file or look through it to see if there are any errors? Let me know if you have any questions about collecting this

@vscodebot
Copy link

vscodebot bot commented Sep 22, 2017

This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions.

@vscodebot vscodebot bot closed this as completed Sep 22, 2017
@intoCL
Copy link
Author

intoCL commented Sep 24, 2017

Sorry this took so long. I checked the file and there were indeed some errors.

Global cache location '/home/user/.cache/typescript/2.5', safe file path '/usr/share/code/resources/app/extensions/node_modules/typescript/lib/typingSafeList.json'
Processing cache location '/home/user/.cache/typescript/2.5'
Trying to find '/home/user/.cache/typescript/2.5/package.json'...
Loaded content of '/home/user/.cache/typescript/2.5/package.json': {}
Finished processing cache location '/home/user/.cache/typescript/2.5'
Process id: 23265
NPM location: "/usr/bin/npm" (explicit '--npmLocation'  provided)
Npm config file: /home/user/.cache/typescript/2.5/package.json
Updating types-registry npm package...
Updated types-registry npm package
Got install request {"projectName":"/projects/dev/workspace/vstest/jsconfig.json","fileNames":["/usr/share/code/resources/app/extensions/node_modules/typescript/lib/lib.d.ts","/projects/dev/workspace/vstest/app.js"],"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"configFilePath":"/projects/dev/workspace/vstest/jsconfig.json","allowNonTsExtensions":true},"typeAcquisition":{"enable":true,"include":["jquery"],"exclude":[]},"unresolvedImports":[],"projectRootPath":"/projects/dev/workspace/vstest","kind":"discover"}
Explicitly included types: ["jquery"]
Typing names in '/projects/dev/workspace/vstest/package.json' dependencies: ["jquery"]
Inferred typings from unresolved imports: []
Result: {"cachedTypingPaths":[],"newTypingNames":["jquery"],"filesToWatch":["/projects/dev/workspace/vstest/package.json","/projects/dev/workspace/vstest/bower_components","/projects/dev/workspace/vstest/node_modules"]}
Finished typings discovery: {"cachedTypingPaths":[],"newTypingNames":["jquery"],"filesToWatch":["/projects/dev/workspace/vstest/package.json","/projects/dev/workspace/vstest/bower_components","/projects/dev/workspace/vstest/node_modules"]}
Sending response: {"projectName":"/projects/dev/workspace/vstest/jsconfig.json","typeAcquisition":{"enable":true,"include":["jquery"],"exclude":[]},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"configFilePath":"/projects/dev/workspace/vstest/jsconfig.json","allowNonTsExtensions":true},"typings":[],"unresolvedImports":[],"kind":"action::set"}
Response has been sent.
Closing file watchers for project '/projects/dev/workspace/vstest/jsconfig.json'
No watchers are registered for project '/projects/dev/workspace/vstest/jsconfig.json'
Installing typings ["jquery"]
Npm config file: /home/user/.cache/typescript/2.5/package.json
Sending response: {"kind":"event::beginInstallTypes","eventId":1,"typingsInstallerVersion":"2.5.2","projectName":"/projects/dev/workspace/vstest/jsconfig.json"}
Response has been sent.
#1 with arguments'["@types/jquery@ts2.5"]'.
npm install #1 took: 7058 ms
stdout: 
stderr: npm WARN package.json @ No description
npm WARN package.json @ No repository field.
npm WARN package.json @ No README data
npm http GET https://registry.npmjs.org/types/jquery
npm http 404 https://registry.npmjs.org/types/jquery
npm ERR! TypeError: Object.keys called on non-object
npm ERR!     at Function.keys (native)
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:708:24)
npm ERR!     at /usr/share/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.13.0-108-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--ignore-scripts" "@types/jquery@ts2.5" "--save-dev" "--user-agent=typesInstaller/2.5.2"
npm ERR! cwd /home/user/.cache/typescript/2.5
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! type called_on_non_object
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/user/.cache/typescript/2.5/npm-debug.log
npm ERR! not ok code 0

install request failed, marking packages as missing to prevent repeated requests: ["jquery"]
Sending response: {"kind":"event::endInstallTypes","eventId":1,"projectName":"/projects/dev/workspace/vstest/jsconfig.json","packagesToInstall":["@types/jquery@ts2.5"],"installSuccess":false,"typingsInstallerVersion":"2.5.2"}
Response has been sent.

@mjbvz mjbvz reopened this Sep 25, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Sep 25, 2017

Looks like we are using an old node/npm version here:

node -v v0.10.25
npm -v 1.3.10

Do you have more modern versions installed on your system? If you do, try telling VSCode where it is installed using the "typescript.npm" setting

@vscodebot vscodebot bot closed this as completed Oct 4, 2017
@vscodebot
Copy link

vscodebot bot commented Oct 4, 2017

This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

3 participants