Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript npm Basics (retiring) Installing Packages with npm Installing Local Packages

How 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
Ari Misha
19,268 Points

Hiya 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