Moment in typescript not recognized? - angularjs

I ran these commands:
npm install tsd -g
tsd install moment --save
it is also injecting into my module but when i am accessing it it is not recognizing moment.
eg.
import * as moment from 'moment';
Could you please help me out.

Try this .
npm install #types/moment --save-dev
It is best to install the typescript definition files as developer dependencies
Then import like this
import * as moment from "moment"

Related

Cannot use MUI 'ContentCopy' icon

I am trying to use the icon 'ContentCopy' from MUI.
https://mui.com/components/material-icons/ says to use the following import:
import ContentCopyIcon from '#mui/icons-material/ContentCopy';
No matter what I do, I get the error:
Module not found: Can't resolve '#mui/icons-material/
I have already tried the following:
npm install #material-ui/core
npm install #material-ui/icons
I also tried deleting my node-modules and re-running npm install.
Any ideas on what else I could try??
It seems that you confused of using version 4 and 5.
You need to install the icons of version 5.
npm install #mui/icons-material
And import the icon from the module.
import ContentCopyIcon from '#mui/icons-material/ContentCopy';
Please refer to this.
to version 5 you need to install mui
npm install #mui/icons-material
mui contains all the icons
from '#mui/icons-material/_';
info https://www.npmjs.com/package/#mui/icons-material

Cannot find module '#uppy/core' or its corresponding type declarations

I'm trying to run Uppy React example from official site https://uppy.io/docs/react/. I'm new with React, I installed
npm install #uppy/react
but it showed next errors:
I should have installed core and tus :-D
npm install #uppy/core
npm install #uppy/tus

ABP Property 'tz' does not exist on type 'typeof moment'

I downloaded .NET Core & ReactJS template from aspnetboilerplate.com .
I initialized the db.
In reactjs folder, I ran npm install and npm start commands.
I get this error:
Property 'tz' does not exist on type 'typeof moment'.
I tried these :
Delete node_modules folder and run npm install and npm start commands
npm i #types/moment-timezone --save-dev
npm i #types/moment-timezone --save
How can I start this project?
#types/moment-timezone has been deprecated. Try the following:
npm uninstall #types/moment-timezone
Using the following code:
import * as moment from 'moment';
import 'moment-timezone';
Also, take a look at the issue on GitHub
You have to download another package for tz.
npm i moment-timezone
and import both like this
import 'moment-timezone';
import moment from 'moment';

How to use bootstrap-notify in react

i want to use http://bootstrap-notify.remabledesigns.com/ in my react app, i have tried to follow Using bootstrap-notify with Angular 7 but getting error "$.notify is not a function" in console
You need the necessary imports:
import $ from "jquery";
import "bootstrap-notify";
You will need to load them using npm i jquery --save and npm i bootstrap-notify --save. I also had some compiler errors after installing, which I fixed with: (see here)
npm install --save --save-exact react-scripts#3.4.0

Module not found Error: Can't resolve 'history' in #types/history

Am developing a React Application where I want to use #types/history module..
Installed
npm install --save #types/history
And in my component file trying to import like
import { createBrowserHistory, History } from 'history'
And
import { createBrowserHistory, History } from '#types/history'
But throwing exception like
Module not found: Can't resolve 'history' in
Thanks in advance.
When installing #types/history you are just providing typescript compiler with type information about history package. Not the package itself. See for example this thread for some details.
Therefore - you must install history package in order to use it:
$ npm install --save history
See more info about its usage at their github rep.
try to install history and react router dom package using npm
npm install --save history
npm install react-router-dom --save

Resources