Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialOsaro Igbinovia
Full Stack JavaScript Techdegree Student 15,928 PointsHow can I install NPM or configure 'typescript.com' in user settings on my Visual Studio Code?
Whenever I open up a JavaScript file in my text editor (Visual Studio Code) I always see this message in the top most bar "Warn Could not install typings files for JavaScript language features. Please ensure that NPM is installed or configure 'typescript.npm' in your user settings".
And whenever I try to use Node.js in the terminal, I get this message " 'node' is not recognized as an internal or external command, operable program or batch file."
Please how can I fix this problem and run command line applications in my text editor?
1 Answer
Ari Misha
19,323 PointsHiya there! You probably dont have your path variable set for npm on your machine. And typescript has nothing to do with this issue. VS Code is built on TypeScript for type checking when you're using JavaScript. But i'd suggest you to uninstall Node from your machine and re-install Node from here. Make sure you install the latest version of Node. Node comes with npm and it also sets the PATH_VARIABLE for terminal. In order to check if the path variable set or not , you can try this command node --version
or npm --version
.
You can also go for other package managers like Yarn without npm. Follow the steps if you're on Mac:
$ brew install yarn //this installation comes with npm automatically installed to your machine
$ brew install yarn --without-node //installs without node
There is another way to install yarn with npm and node:
$ sudo port install yarn
And for some reasons, the path for yarn is not set, try this in your terminal:
$ export PATH="$PATH:`yarn global bin`"
This command will set yarn globally and add the path to the path variable.
~ Ari