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
Code Insider complains "Could not install typings files for JS/TS language features. Please ensure that NPM is installed" #24961
Comments
Can you please share the output from running:
in your terminal |
Same error ➜ ~ which npm
/usr/local/bin/npm
➜ ~ npm --version
4.0.5 That said, I don't use TS. The error led me here. |
TypeScript powers both our JavaScript and TypeScript language features. To diagnose this, can you please try collecting the tsserver log:
|
having the same issue with code-insiders and however, I think its related to this issue #10876 and if I open from the CLI, the issue does not persist. |
I've opened microsoft/TypeScript#15287 to track typings install issues when using n/nvm. If you run into this, as a workaround, try fully restarting VSCode. If you are running from the command prompt, also restart that. This should ensure that VSCode is using the current PATH. (#23649 tracks re-reading the environment for each new VSCode window) @DrkCoater / TheSisb Are you using n or nvm? Can you also try restarting VSCode fully to see if you are also running into a PATH issue |
My npm is in path actually, although I'm also using nvm. I have already restarted my machine as well as Code fully serval times. The warning still coming up. I think it only happened since an update some time last week, it didn't happen before. thanks which npm: |
And I found this related log message from the tsserver.log according to your procedures: Info 29 Received response: {"kind":"event::initializationFailed","message":"Command failed: npm install types-registry"} |
Yes, we added this warning message recently to catch cases just like this. When typescript cannot find npm, automatic typing acquisition will not work. #25112 added a way to disable this warning if it is getting in the way. @DrkCoater Can you open the developer console ( If this is the case, try running code from the command line to ensure the proper |
@joaomoreno Any thoughts on ensuring we pick up the PATH from a user's |
@DrkCoater says
And I agree with him. This already happened to me twice, and only after an update. So it has something to do with how Squirrel reinitialises the app once updated. For sure it didn't happen before |
What make you so sure about that? The only thing we do while lazyEnv is working is loading code, the extension host gets its environment only when being started |
A feeling. It could also be a coincidence that this message appeared at around roughly the same time. |
@mjbvz FYI, for process.env['PATH'], my path is actually there: |
Even after an update, if I quite and re-open the app normally the issues persists. If I open from the CLI, then it will go away and my |
This reproduces after each start from the dock on Ubuntu. ATA still works afterwards, probably from the existing .d.ts cache. The reason for this is |
Whooot 😱 |
@joaomoreno @jrieken @Tyriar Any idea why |
This should only be set when launching via |
I have no clue. Something must be setting it in your system... Weird. |
I accepted a pull request this iteration that changed the desktop entry to launch through the CLI: #24523, #10091 So reading through these issues it looks like here is what is going on:
The obvious fix here is to move the ATA PATH setup to |
We don't do anything specific to set up ATA. All we need is a PATH that has On my Mac and Ubuntu test machines at least, nvm only added itself to the |
@chrmarti I'm not running as root, in fact OS X Sierra makes it hard to even edit /usr/bin and the likes due to System Integrity Protection... Permissions are 755 with root:wheel as owner. |
@bernljung Your previous comment says |
I've tried both. Npm is installed in /usr/local/bin/npm and then symlinked to /usr/bin/npm and /usr/sbin/npm. (for VSC testing only) |
I'm still getting this issue on v1.16 running on Antergos. |
Thanks @viktor-wolf! I've opened microsoft/TypeScript#18344 to track this failure. Can you please try running |
The only way I can get this to work is by launching VS Code via the command line, https://code.visualstudio.com/docs/setup/mac. If I open it from the Dock on OS X, it always gives this error, even when adding |
@nickytonline Thanks for the tip. I tried launching Code from CLI and it didn't show the error. After that initial CLI launch I no longer get it even when I launch from a shortcut. However, I'm not sure if the underlying problem got fixed, since I still have the types-registry error in my ts log. |
@viktor-wolf, I'll check my logs when I have a chance to see if it still persisted. |
Actually, disregard my previous comment. I just went to change some preferences and I noticed that the typescript check was disabled ("typescript.check.npmIsInstalled": false). I must have misclicked on the "Don't check again" option at some point without noticing. After removing this setting I started getting the warning again, whether I run Code from terminal or not. |
Still have the problem with new version 1.16.1 What should I do? @mjbvz $ /Users/angel/.nvm/versions/node/v8.5.0/bin/npm install --ignore-scripts types-registry
npm ERR! path /Users/angel/abx/node_modules/.staging/types-registry-38e9fd4a/
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall open
npm ERR! EISDIR: illegal operation on a directory, open '/Users/angel/abx/node_modules/.staging/types-registry-38e9fd4a/'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/angel/.npm/_logs/2017-10-05T16_57_51_693Z-debug.log |
I've just updated tsc from 2.5.2 to 2.5.3 |
I upgraded typescript to 2.5.3 and am still seeing this. |
|
Having the issue too, VSCode 1.6.1, npm 4.6.1, typescript 2.5.3, running on Debian. |
and its gone again. just restarted VSC like 8 times. my guess is it sends a request to the typings repository. and probably because of the load gets no/error response. shows a wrong error though. |
I temporarily solved it by running sudo npm install -g types-registry |
I just ran into this issue. I also had an issue running: I created the .staging directory manually, then the npm install was successful and the message went away: Version 1.17.0-insider |
I've just got this warning on my VSCode (1.16.1 updated few weeks ago) after updating npm from 5.4.2 to 5.5.1 with
|
Got back to npm 5.4.2 with |
Started getting this as well with the stock In TS Server log:
Of important note is that we use internal npm registry at work (not sure what's the provider, but it's not NPM Inc.) so my
When I use the public one VSCode works fine. When I comment out the public one and use the internal one I get the error. This used to work without issues forever, so not sure what happened all of a sudden to cause it. It seems [EDIT] Update. The error went away after a little while as our mirror picked up the new |
Any idea why this issue is closed? I get the same error on a fresh install of VSC. I'm using nvm via linux subsystem (Ubuntu) on Win 10 |
@jasonpolites Please open a new issue if you don't see this working. Also, have you looked through the documentation on this: https://code.visualstudio.com/Docs/languages/javascript#_fixing-npm-not-installed-warning-for-automatic-type-acquisition |
I will open a new issue as I've run out of things to try (including the aforementioned docs). Thanks! |
I'm also getting this error message. Can anyone give instructions in plain english how to fix this? |
Locking this issue. Please see our documentation on solving this problem. If you still have problems after following the steps in the docs, please open a new issue |
Steps to Reproduce:
"Could not install typings files for JS/TS language features. Please ensure that NPM is installed"
The text was updated successfully, but these errors were encountered: