unable to reinstall due to removal of global typing

After globally installing Moment typing with the command

typings install dt~moment --save --global

Checking the installed typings using typings list shows:

├── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93fffcf7f2e0fbd3a7bda3bda3">[email protected]</a>
├── es6-shim (global)
└── moment (global)

Deciding to uninstall it globally with

typings uninstall moment --global

Another check of the typings list displays:

├── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="630f0c0702100b23574d534d53">[email protected]</a>
└── es6-shim (global)

Trying to install in the current directory using typings install dt~moment --save results in an error message:

typings ERR! message Attempted to compile "moment" as an external module, but it looks like a global module. You'll need to enable the global option to continue.

Frustrated by this issue, I also attempted to clear the cache without success.

node v5
npm v3.3.9
tsc v1.8.10

Answer №1

Update: Consider upgrading to TypeScript 2.0 in order to easily install typings using npm.

npm install @types/moment

Read more here for the future of declaration files Visit this link to access @types/moment on npm

This information may provide some assistance.

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's the best way to display a component once a function has been executed?

My service controls the visibility of components using *ngIf! Currently, when I click a button, the service sets to true and the components appear instantly! I want the components to only show after a specific function has finished executing. This means I ...

Issues with modals appearing improperly after transitioning to NG-Bootstrap 15 and Bootstrap 5 upgrade

UPDATED following a thorough examination: In the process of upgrading our application from NG-Boostrap v11 with bootstrap 4 to NG-Boostrap v15 with Bootstrap 5 and Popper, we also made the switch from Angular 15 to Angular 16. Despite successfully resolvi ...

"Incorporating multiple router modules in Angular 4/5, with a parent router module overseeing all

Is there a way to have multiple router modules in Angular, such as Core and Main with their own separate routing modules, and then import these two routing modules into our parent routing module (app.routing.ts/app.module.ts)? ...

Having trouble installing Angular CLI on a Windows system with the latest version of npm

I am encountering an issue while attempting to install Angular CLI on my Windows 7 system through the command prompt using npm. The error message I receive is: D:\Users\uname>npm install -g @angular/cli npm ERR! code ELOOP npm ERR! sysca ...

Cookies with the HttpOnly attribute are not transmitted in a request

I have implemented the use of HttpOnly cookies in my Java code like this: ... Cookie accessTokenCookie = new Cookie("token", userToken); accessTokenCookie.setHttpOnly(true); accessTokenCookie.setSecure(true); accessTokenCookie.setPath("/"); response.addC ...

Here is a guide on implementing Hash in URLs with React Router

I'm brand new to React and running into an issue. My page has two tabs and I would like to create a hash URL that will redirect to the corresponding tab based on the URL hash. Additionally, when I change tabs, I want the URL to update as well. Please ...

Implementing unique union type in React: Effective ways to declare typescript type for prop value

I am currently facing an issue where I need to set a specific type for a prop value. However, the challenge lies in the fact that the types are string unions which can vary depending on the usage of the React Component. Let me provide you with the TypeScr ...

Localization & Internationalization in Angular 6 CLI for enhancing multi-language functionality

Our Application is built on Angular 6 and we are looking to incorporate multilingual support. Please advise on how we can enable localization and internationalization in Angular 6. This pertains specifically to the Angular 6 version. ...

What is a more efficient way to differentiate a group of interfaces using an object map instead of using a switch statement?

As someone still getting the hang of advanced typescript concepts, I appreciate your patience. In my various projects, I utilize objects to organize react components based on a shared prop (e.g _type). My goal is to automatically determine the correct com ...

Choosing options using an enum in Angular 2

In my TypeScript code, I have defined an enum called CountryCodeEnum which contains the values for France and Belgium. export enum CountryCodeEnum { France = 1, Belgium = 2 } Now, I need to create a dropdown menu in my form using this enum. Each ...

Display problem with Angular 2 component: dimensions are missing

I have a question regarding using a component-selector to display a component: <app-search></app-search> After adding this component, I noticed that the width and height of the rendered component in the developer console are 0px x 0px. As a r ...

What is the process for updating an Angular application when a new dependency is added to the package.json file and how can it be used in

Currently, I am facing an issue while trying to utilize a new dependency in the package.json file and importing it into the component file. Despite attempting to install or update the dependency using npm, I encounter difficulties with the import process a ...

The promise was not handled properly as it was rejected with the message: "The constructor xhr2

Currently, I am working on developing an application using ASPNetCore and Angular 5 with Webpack. However, after upgrading to Angular 5, I encountered the following error: Unhandled Promise rejection: xhr2.XMLHttpRequest is not a constructor ; Zone: <r ...

Exploring the File Selection Dialog in Node.js with TypeScript

Is it possible to display a file dialog in a Node.js TypeScript project without involving a browser or HTML? In my setup, I run the project through CMD and would like to show a box similar to this image: https://i.stack.imgur.com/nJt3h.png Any suggestio ...

Sending an onclick event to a child class through React and TypeScript

I'm currently working through the Facebook React tutorial with Typescript for the first time. I need to pass an onClick event to the 'Square' component, which is implemented using Typescript and interfaces for state and props. How can I mod ...

Issue with Switch Map in Angular 2 and RxJS

I'm currently implementing an infinite scrolling feature in my application using a specific component for managing scroll events. When the scroll reaches the bottom of the div, I trigger a function to fetch more data. Everything seems to be working fi ...

Differences Between NgModule and AppComponent in Angular

Being a novice in the realm of Angular, I'm curious to know the distinction between CommonModule and BrowserModule, and when one should be prioritized over the other. ...

Utilizing ngClassEven and ngClassOdd in Angular 2 for Improved Styling

I attempted to replicate the behavior of ng-class-even and ng-class-odd (originally from Angular 1) in my Angular 2 application. Below is the code I wrote and it's functioning correctly, but I'm curious if there are alternative methods to achiev ...

The type 'TaskListProps[]' cannot be assigned to type 'TaskListProps'

I'm struggling with handling types in my TypeScript application, especially with the TaskListProps interface. export default interface TaskListProps { tasks: [ { list_id: string; title: string; description: string; status ...

Steps for integrating third party modules into an Angular library built with the CLI

Looking to integrate Pure.css module into an Angular library developed with the CLI's generate library command. In my workspace app, I used the generate library command to create a new library. After successfully creating and linking it to another pr ...