Material-UI Can't import slider - node.js

import Slider from '#material-ui/lab/Slider';
returns an error on build
ERROR in ./src/components/StepSlider/StepSlider-view.jsx
Module not found: Error: Can't resolve '#material-ui/lab/Slider' in 'D:\GIT\...\components\StepSlider'
# ./src/components/StepSlider/StepSlider-view.jsx 2:0-45 29:26-32
# ./src/components/StepSlider/index.js
# ./src/components/plan_option_slider/PlanOptionSlider-view.jsx
# ./src/components/plan_option_slider/index.jsx
# ./src/features/plans/plans-view.jsx
# ./src/features/plans/index.jsx
# ./src/App.jsx
# ./src/index.jsx
Searching this error tells me to install lab, I'd already done that, but figured I'd give it another chance:
npm install #material-ui/lab
npm WARN bootstrap#4.4.1 requires a peer of popper.js#^1.16.0 but none is installed. You must install peer dependencies yourself.
npm WARN material-ui-pickers#2.2.4 requires a peer of #material-ui/core#^3.2.0 but none is installed. You must install
peer dependencies yourself.
npm WARN restaurant_project#1.0.0 No description
npm WARN restaurant_project#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #material-ui/lab#4.0.0-alpha.40
updated 1 package and audited 12006 packages in 13.041s
found 0 vulnerabilities
I followed this:
npm WARN ... requires a peer of ... but none is installed. You must install peer dependencies yourself
(I was pretty sure I had all this installed, but figured I'd follow directions)
npm install --save-dev popper.js#^1.16.0
npm WARN deprecated popper.js#1.16.0: Popper changed home, find its new releases at #popperjs/core
npm WARN material-ui-pickers#2.2.4 requires a peer of #material-ui/core#^3.2.0 but none is installed. You must install
peer dependencies yourself.
npm WARN restaurant_project#1.0.0 No description
npm WARN restaurant_project#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ popper.js#1.16.0
updated 1 package and audited 12007 packages in 15.415s
found 0 vulnerabilities
npm install --save-dev #material-ui/core#^3.2.0
npm WARN #material-ui/icons#4.5.1 requires a peer of #material-ui/core#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #material-ui/lab#4.0.0-alpha.40 requires a peer of #material-ui/core#^4.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN restaurant_project#1.0.0 No description
npm WARN restaurant_project#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #material-ui/core#3.2.0
added 4 packages from 4 contributors, removed 26 packages, updated 5 packages and audited 11946 packages in 25.503s
found 0 vulnerabilities
This looks worrisome, it seems like the lab is asking for core4.9.0, but okay:
npm install --save-dev #material-ui/core#^4.0.0
npm WARN #material-ui/lab#4.0.0-alpha.40 requires a peer of #material-ui/core#^4.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN material-ui-pickers#2.2.4 requires a peer of #material-ui/core#^3.2.0 but none is installed. You must install
peer dependencies yourself.
npm WARN restaurant_project#1.0.0 No description
npm WARN restaurant_project#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #material-ui/core#4.0.0
added 26 packages from 8 contributors, removed 6 packages, updated 1 package and audited 12027 packages in 14.485s
found 0 vulnerabilities
So now it's telling me I need #material-ui/core#^3.2.0 again -- great, let me see if I can ignore that (it'll clear out the 4.9.0 I just installed)
npm install --save-dev #material-ui/core#^4.9.0
npm WARN material-ui-pickers#2.2.4 requires a peer of #material-ui/core#^3.2.0 but none is installed. You must install
peer dependencies yourself.
npm WARN restaurant_project#1.0.0 No description
npm WARN restaurant_project#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #material-ui/core#4.9.0
added 5 packages from 4 contributors, removed 3 packages, updated 5 packages and audited 12007 packages in 15.823s
found 0 vulnerabilities
Alright, let's see if I can build it now.
No dice
ERROR in ./src/components/StepSlider/StepSlider-view.jsx
Module not found: Error: Can't resolve '#material-ui/lab/Slider' in 'D:\GIT\...\src\components\StepSlider'
# ./src/components/StepSlider/StepSlider-view.jsx 2:0-45 29:26-32
# ./src/components/StepSlider/index.js
# ./src/components/plan_option_slider/PlanOptionSlider-view.jsx
# ./src/components/plan_option_slider/index.jsx
# ./src/features/plans/plans-view.jsx
# ./src/features/plans/index.jsx
# ./src/App.jsx
# ./src/index.jsx
I'll try updating everything:
npm update
npm WARN deprecated popper.js#1.16.1: Popper changed home, find its new releases at #popperjs/core
npm WARN material-ui-pickers#2.2.4 requires a peer of #material-ui/core#^3.2.0 but none is installed. You must install
peer dependencies yourself.
npm WARN restaurant_project#1.0.0 No description
npm WARN restaurant_project#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ popper.js#1.16.1
updated 1 package and audited 12007 packages in 14.471s
found 0 vulnerabilities
build again:
no dice
ERROR in ./src/components/StepSlider/StepSlider-view.jsx
Module not found: Error: Can't resolve '#material-ui/lab/Slider' in 'D:\GIT\...\src\components\StepSlider'
# ./src/components/StepSlider/StepSlider-view.jsx 2:0-45 29:26-32
# ./src/components/StepSlider/index.js
# ./src/components/plan_option_slider/PlanOptionSlider-view.jsx
# ./src/components/plan_option_slider/index.jsx
# ./src/features/plans/plans-view.jsx
# ./src/features/plans/index.jsx
# ./src/App.jsx
# ./src/index.jsx
I'll try w/ the new popper
npm install #popperjs/core
npm WARN material-ui-pickers#2.2.4 requires a peer of #material-ui/core#^3.2.0 but none is installed. You must install
peer dependencies yourself.
npm WARN restaurant_project#1.0.0 No description
npm WARN restaurant_project#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #popperjs/core#2.0.0
added 1 package from 1 contributor and audited 12008 packages in 19.887s
found 0 vulnerabilities
I'm lost, any help would be REALLY appreciated

https://material-ui.com/guides/migration-v3/
[Container] Moved from #material-ui/lab to #material-ui/core.
-import Container from '#material-ui/lab/Container';
+import Container from '#material-ui/core/Container';
after reading this I tested to see if they moved Slider too, they did.
import Slider from '#material-ui/lab/Slider';
should be
import Slider from '#material-ui/core/Slider';
Hope this saves someone else the time I wasted

Related

npm warning after upgrading angular version

I am facing the below warnings while upgrading from angular 8 to 14. I can build and run application properly despite the warning. However, I would like to remove the warning. Below is the warning. How do I remove it?
Angular version: 14.2.0
nodejs version : 14.17.6
npm WARN ajv-keywords#3.5.2 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer#6.0.2 requires a peer of #angular/compiler#>=2.3.1 <13.0.0 || ^12.0.0-next || ^12.1.0-next || ^12.2.0-next but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer#6.0.2 requires a peer of #angular/core#>=2.3.1 <13.0.0 || ^12.0.0-next || ^12.1.0-next || ^12.2.0-next but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-64#0.15.5 (node_modules\esbuild-darwin-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-64#0.15.5: wanted {"os":"darwin","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64#0.15.5 (node_modules\esbuild-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64#0.15.5: wanted {"os":"android","arch":"arm64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: #esbuild/linux-loong64#0.15.5 (node_modules#esbuild\linux-loong64):

Unable to remove npm warn message while running angular application

I need one help. I need to remove the npm warn message while I am trying to do the npm install through dockerfile. I am explaining those warning message below.
while running RUN npm install --no-package-lock getting the following warn message.
npm WARN deprecated #angular/http#7.2.16: Package no longer supported. Use #angular/common instead, see https://angular.io/guide/deprecations#angularhttp
npm WARN deprecated core-js#2.6.12: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated ag-grid#18.1.2: ag-grid is now deprecated - please use #ag-grid-community/all-modules. See www.ag-grid.com/javascript-grid-modules/ for more information.
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated fsevents#2.1.2: "Please update to latest v2.3 or v2.2"
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated ini#1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated chokidar#2.0.4: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated clipboard-js#0.3.6: Please migrate to https://github.com/lgarron/clipboard-polyfill
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
and while running RUN npm install then getting the following warnings.
npm WARN deprecated fsevents#2.1.2: "Please update to latest v2.3 or v2.2"
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.3.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/#angular/compiler-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN #auth0/angular-jwt#5.0.2 requires a peer of #angular/common#>=9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-file-drop#5.0.2 requires a peer of #angular/common#^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-file-drop#5.0.2 requires a peer of #angular/core#^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-file-drop#5.0.2 requires a peer of #angular/platform-browser#^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-file-drop#5.0.2 requires a peer of rxjs#^5.5.2 but none is installed. You must install peer dependencies yourself.
So here I need to remove these warnings while running those command through dockerfile. I also tried many options by searching from google but those did not give the right solutions. Can any body help me to resolve this issue ?

trying to upgrade #ng-bootstrap/ng-bootstrap but it stays the same version

Angular CLI: 10.1.2
Node: 12.18.1
OS: win32 x64
Angular: 10.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
#angular-devkit/architect 0.1001.2
#angular-devkit/build-angular 0.1001.2
#angular-devkit/core 10.1.2
#angular-devkit/schematics 10.1.2
#angular/http 5.2.11
#schematics/angular 10.1.2
#schematics/update 0.1001.2
rxjs 6.6.3
typescript 4.0.3
I want to upgrade #ng-bootstrap/ng-bootstrap to latest version 7.0.0.
npm #ng-bootstrap/ng-bootstrap -version
6.14.5
When i try to upgrade to version 7.0.0 i get this:
ng add #ng-bootstrap/ng-bootstrap#7.0.0
Skipping installation: Package already installed
An unhandled exception occurred: Cannot find module '#schematics/angular/utility/workspace'
Require stack:
- C:\MyProjects\LunchTime\node_modules\#ng-bootstrap\ng-bootstrap\schematics\ng-add\index.js
- C:\MyProjects\LunchTime\client\node_modules\#angular-devkit\schematics\tools\export-ref.js
- C:\MyProjects\LunchTime\client\node_modules\#angular-devkit\schematics\tools\index.js
- C:\MyProjects\LunchTime\client\node_modules\#angular\cli\utilities\json-schema.js
- C:\MyProjects\LunchTime\client\node_modules\#angular\cli\models\command-runner.js
- C:\MyProjects\LunchTime\client\node_modules\#angular\cli\lib\cli\index.js
- C:\Users\dagul\AppData\Roaming\npm\node_modules\#angular\cli\lib\init.js
- C:\Users\dagul\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng
See "C:\Users\dagul\AppData\Local\Temp\ng-6sWgeN\angular-errors.log" for further details.
I removed node_modules and installed it again and still the same.
My package.json states that 7.0.0 is the version and when i try to add it again it adds 7.0.0 but when i run a version check i still have 6.14.5
PS C:\MyProjects\LunchTime\client> npm install #ng-bootstrap/ng-bootstrap
npm WARN #angular/http#5.2.11 requires a peer of rxjs#^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/http#5.2.11 requires a peer of #angular/core#5.2.11 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/http#5.2.11 requires a peer of #angular/platform-browser#5.2.11 but none is installed. You must install peer dependencies yourself.
npm WARN #nativescript/tslint-rules#0.0.5 requires a peer of tslint#^5.16.0 but none is installed. You must install peer dependencies yourself.
npm WARN #nativescript/tslint-rules#0.0.5 requires a peer of typescript#^3.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN #phenomnomnominal/tsquery#3.0.0 requires a peer of typescript#^3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap#4.5.2 requires a peer of jquery#1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap#4.5.2 requires a peer of popper.js#^1.16.1 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer#3.2.2 requires a peer of #angular/compiler#^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer#3.2.2 requires a peer of #angular/core#^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules\#angular\compiler-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules\rollup\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #ng-bootstrap/ng-bootstrap#7.0.0 <---- THIS ONE!
removed 1 package, updated 1 package and audited 1635 packages in 89.645s
67 packages are looking for funding
run `npm fund` for details
found 3 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
PS C:\MyProjects\LunchTime\client> npm #ng-bootstrap/ng-bootstrap -version
6.14.5 <--- WHY!?
PS C:\MyProjects\LunchTime\client>

Not able to install angularfire2 via npm

I am trying to install angularfire2 from npm by running, but I keep getting this error
D:\angular\firebase\apartment>npm install angularfire2 firebase --save
apartment#0.0.0 D:\angular\firebase\apartment
+-- angularfire2#4.0.0-rc.1
`-- firebase#4.1.3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/common#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/compiler#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/core#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/platform-browser#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/platform-browser-dynamic#^4.0.0 but none was installed.
Last 5 of npm warn's are due to dependencies. You don't have the required modules to install angularfire.
Two possible solutions are, either downgrade your npm i.e. lower than 3.
npm < 3 can download the depending modules by itself or install the 5 depending modules first.

Ionic 2 Final + AngularFire2 : UNMET PEER DEPENDENCY rxjs#5.0.0-beta.12

On Windows 10 with nodejs 7.5.0, after installing the ionic 2 final version there is a peer dependency error (rxjs#5.0.0-beta.12) when installing angularfire2.
Tried on Linux but the result was the same.
ionic -v
2.2.1
npm install angularfire2 --save
ionic-hello-world# D:\nodejs\unRated
+-- angularfire2#2.0.0-beta.7
-- UNMET PEER DEPENDENCY rxjs#5.0.0-beta.12
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN angularfire2#2.0.0-beta.7 requires a peer of rxjs#^5.0.1 but none was installed.
Anyone with the same issue on the final ionic 2 release?
You have to install AngularFire 2.0.0-beta.6 to make it working.
npm install firebase#3.3.0 angularfire2#2.0.0-beta.6
Check this blog for more information https://chriztalk.com/ionic-2-and-firebase/

Resources