What could be the reason for the tsc path not being recognized on a Windows system? The error message " 'tsc' is not recognized as an internal or external

Whenever I execute this command(from Gitbash)

npm run compile

The error message displayed is

'tsc' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE

I verified by running

$ npm config get prefix
C:\Users\romanrublev\AppData\Roaming\npm

After installing tsc(npm i-g tsc). I can locate it in the specified directory https://i.sstatic.net/PdR7X.png

I even checked the environment variables on my Windows system

https://i.sstatic.net/RLBGv.png

Tried reinstalling with these commands

npm install -g typescript
C:\Users\romanrublev\AppData\Roaming\npm\tsc -> C:\Users\romanrublev\AppData\Roaming\npm\node_modules\typescript\bin\tsc
C:\Users\romanrublev\AppData\Roaming\npm\tsserver -> C:\Users\romanrublev\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
+ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8efaf7feebfdedfce7fefacebaa0ba">[email protected]</a>

Why isn't the tsc path being detected? Could there be multiple npms(global,.npmrc) causing this issue?

Answer №1

Below is a detailed guide outlining the solution that successfully resolved my issue. I trust it will be beneficial to you as well.

https://i.sstatic.net/g9kv5.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What are your thoughts on this method? Verifying the existence of a variable or setting it to

const pictureEntity = updateUserDto?.picture ? await this.filesService.find(updateUserDto.picture) : null; if (pictureEntity) { const url = await this.filesService.getFileUrl(pictureEntity); } Is the method used to assign the value to pictureEn ...

Utilizing the JavaScript Array.find() method to ensure accurate arithmetic calculations within an array of objects

I have a simple commission calculation method that I need help with. I am trying to use the Array.find method to return the calculated result from the percents array. The issue arises when I input a price of 30, as it calculates based on the previous objec ...

What is the process for verifying an email address using the deep-email-validator package from npm?

I'm looking to verify the existence of an email address used for registration on my website, ensuring it's not just a temporary one. How can I achieve this utilizing the npm deep-email-validator package? Within my HTML page, I've assigned n ...

What is the proper way to implement ref in typescript?

Currently, I am in the process of learning how to use Vue3 + Typescript. Previously, I have developed Vue2 applications using plain JavaScript. In my current project, I am attempting to define a reactive variable within the setup() function: setup() { ...

Send the dynamically created password variable from the server to the client-side

I'm attempting to transfer the password variable that I've generated to my front-end. The issue seems to be that I am generating the password inside the route.post This snippet is from my fileUpload.route.ts router.post('/upload-file&a ...

Vue.js live timestamp update

I have a function that returns the current timestamp with date and time, but it remains static upon page load without updating (meaning: the seconds and minutes do not change in real-time). Desired Outcome: I want the time to be continuously moving and no ...

What is the best way to prevent the hassle of manually reloading a VS Code extension each time I make updates

While working on my VS Code extension, I keep encountering the issue of opening a new instance of VS Code every time I run the extension to view recent changes. This becomes especially tedious when using VS Code remote and having to enter my password twice ...

How to send a variable to Firestore query in an Angular application

I'm attempting to retrieve data from a schedule collection based on a field matching the user's id. However, I'm encountering an issue with the error message: "Function Query.where() requires a valid third argument, but it was undefined." ...

Personalized ornamentation using TypeScript

Is there a way to access the variables of the class when using a decorator? @ExampleDecorator() export class UserController { private userData: string = "example"; } export const ExampleDecorator = (config: IConfigSettings) => (target: Object) =&g ...

Reset the select boxes when a button is clicked

I'm currently utilizing Devextreme within my Angular application, and I have three dx-selectbox elements in the component. I am attempting to clear all three dropdown selections when clicking a "clear" button. Unfortunately, I am unable to find a way ...

Select specific columns from an array using Typescript

I have a collection of objects and I'm looking for a way to empower the user to choose which attributes they want to import into the database. Is there a method to map and generate a separate array containing only the selected properties for insertion ...

Invoke a static method from within a class in Typescript (Angular HttpInterceptor)

Recently, I've been working on an http interceptor that was functioning smoothly until just yesterday. It consists of static methods, and for some reason, one of them is now causing issues. Here is the error message displayed in the console: my.c ...

Modifying data within nested objects using Typescript

Imagine having an object like this: { b954WYBCC4YbsMM36trawb00xZ32: { activity1: "pending", activity2: "pending" }, ​ pby0CAqQ1hTlagIqBTQf6l2Ti9L2: { activity1: "pending", activity2: "pending" } } with the in ...

Tips for saving the generated POST request ID for future use in another function

I am facing a challenge where I want to use the ID of a newly created Order as the OrderId for an OrderLine that needs to be created immediately after. After creating the Order, if I log the orderId INSIDE THE SUBSCRIBE METHOD, it shows the correct value. ...

What could be causing the Angular error related to this HttpHeader?

Is there anyone who can assist me with why I am encountering an error in my Angular code while trying to use HttpHeaders to read the response status from the backend? Here is the specific error message: https://i.sstatic.net/tQu5t.jpg import { Injectable ...

Handling Errors in RxJS: A guide to propagating errors from observables

I recently started learning RxJS and am currently focusing on observables and subjects. I have a basic login code that is split into two separate files: a) auth.service.ts and b) login.component.ts Below is the content of login.component.ts: public login( ...

Can you explain the purpose of the command "npm cache clean --force --unsafe-perm

When I was in the process of creating a React JS project using npx create-react-app testproject An error message popped up, which read: Unhandled rejection Error: EACCES: permission denied, open /Users/username/.npm/_cacache/index-v5/cb/f5/5167796b1df60 ...

Plugin for NPM.JS that allows direct interaction with the Linux command line

Currently, I am faced with a challenge in my project which involves using node.js. I have been searching for a plugin that can initiate a system shutdown without any manual intervention. After some research, I realized that by accessing bash (the command l ...

Ways to resolve the npm error "peer dependency missing"

While reviewing the list of npm packages installed with npm list --depth 0 I came across two errors after the npm packages. Can anyone explain why these errors are occurring and how to resolve them? npm ERR! peer dep missing: chartist@^0.10.1, required ...

Step-by-step guide on importing `block-ui`, `spectrum-colorpicker`, and `sass.js` libraries in a TypeScript project

I have been utilizing various plugins such as block-ui, spectrum-colorpicker, sass.js, etc., in my Angular 2 project written in TypeScript. Currently, I am loading these plugins directly in the index.html file. However, I would like to import them and onl ...