React router is not installing on my Windows machine - javascript

This is the command that I ran to install react-router :-
npm install --save react-router
This is the output shown by my prompt window :-
npm WARN #babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining#7.15.4 requires a peer of #babel/core#^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.21.0 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\watchpack-chokidar2\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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\webpack-dev-server\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"})
+ react-router#5.2.1
updated 1 package and audited 1960 packages in 20.878s
148 packages are looking for funding
run `npm fund` for details
found 3 moderate severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
Please help me to resolve this.

npm i install-peers -D
You can use this to install peer dependencies.
I was having the same issues it worked out for me.

Related

npm WARN Laravel errors don't allow me to have CSS implemented on my localhost

This are my tailwindcss errors:
npm WARN #tailwindcss/custom-forms#0.2.1 requires a peer of tailwindcss#^1.0 but none is installed. You must install peer dependencies yourself.
npm WARN #tailwindcss/typography#0.2.0 requires a peer of tailwindcss#^1.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN #tailwindcss/ui#0.7.2 requires a peer of tailwindcss#^1.8.3 but none is installed. You must install peer dependencies yourself.
Optional and not supported errors:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules\laravel-mix\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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules\webpack-dev-server\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"})
A screenshot of localhost after auth:
https://i.stack.imgur.com/8Rbzr.png
composer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run dev

how fix Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

when i am trying to install nodemon I see this:
PS C:\WINDOWS\system32> npm install -g nodemon
C:\Users\lukos\.npm-global\nodemon -> C:\Users\lukos\.npm-
global\node_modules\nodemon\bin\nodemon.js
> nodemon#2.0.6 postinstall C:\Users\lukos\.npm-global\node_modules\nodemon
> node bin/postinstall || exit 0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2
(node_modules\nodemon\node_modules\chokidar\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"})**
+ nodemon#2.0.6
updated 1 package in 6.746s
I tried clear npm cache but it didn't help, uninstall and try with other flags or without any.
optionally I see it:
PS C:\WINDOWS\system32> npm install nodemon
> nodemon#2.0.6 postinstall C:\WINDOWS\system32\node_modules\nodemon
> node bin/postinstall || exit 0
npm WARN saveError ENOENT: no such file or directory, open
'C:\WINDOWS\system32\package.json'
npm WARN enoent ENOENT: no such file or directory, open
'C:\WINDOWS\system32\package.json'
npm WARN system32 No description
npm WARN system32 No repository field.
npm WARN system32 No README data
npm WARN system32 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3
(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"})
+ nodemon#2.0.6
added 1 package from 1 contributor and audited 182 packages in 0.849s
10 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities

React.js - warnings & errors while using "npx create-react-app" command

I get some warnings and errors messages when try to create a react.js app using the command npx creat-react-app
here is the terminal output containing the errors I get. also I wanna specify that when the react.js app is created regardless of these errors it's actually working. but I'm afraid of that if there is something missing. Node.js and all of the required tools are installed as well.
Node.js version: LTS Version 12.18.4 (includes npm 6.14.6)
C:\Users\Administrator\Desktop\cmder
λ npx create-react-app my-app
Creating a new React app in C:\Users\Administrator\Desktop\cmder\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
> core-js#2.6.11 postinstall C:\Users\Administrator\Desktop\cmder\my-app\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js#3.6.5 postinstall C:\Users\Administrator\Desktop\cmder\my-app\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure#3.6.5 postinstall C:\Users\Administrator\Desktop\cmder\my-app\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
+ react-dom#16.13.1
+ react-scripts#3.4.3
+ cra-template#1.0.3
+ react#16.13.1
added 1598 packages from 746 contributors and audited 1602 packages in 65.645s
69 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Initialized a git repository.
Installing template dependencies using npm...
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
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":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\jest-haste-map\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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\watchpack-chokidar2\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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\webpack-dev-server\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"})
+ #testing-library/user-event#7.2.1
+ #testing-library/jest-dom#4.2.4
+ #testing-library/react#9.5.0
added 36 packages from 57 contributors and audited 1638 packages in 13.978s
69 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Removing template package using npm...
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
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":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\jest-haste-map\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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\watchpack-chokidar2\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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\webpack-dev-server\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"})
removed 1 package and audited 1637 packages in 10.641s
69 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Git commit not created Error: Command failed: git commit -m "Initialize project using Create React App"
at checkExecSyncError (child_process.js:630:11)
at execSync (child_process.js:666:15)
at tryGitCommit (C:\Users\Administrator\Desktop\cmder\my-app\node_modules\react-scripts\scripts\init.js:62:5)
at module.exports (C:\Users\Administrator\Desktop\cmder\my-app\node_modules\react-scripts\scripts\init.js:334:25)
at [eval]:3:14
at Script.runInThisContext (vm.js:120:18)
at Object.runInThisContext (vm.js:309:38)
at Object.<anonymous> ([eval]-wrapper:10:26)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at evalScript (internal/process/execution.js:94:25) {
status: 128,
signal: null,
output: [ null, null, null ],
pid: 1532,
stdout: null,
stderr: null
}
Removing .git directory...
Success! Created my-app at C:\Users\Administrator\Desktop\cmder\my-app
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd my-app
npm start
Happy hacking!
Git commit not created Error: Command failed: git commit -m
"Initialize project using Create React App"
Seems like you don't have git installed. Install git if you want cra to initialize a git repository. If you don't plan on using git, you should just ignore the error.
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
This is an optional dependency for mac (darwin)
This thread points out that you can use npm install --no-optional to prevent warning from happening.
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
Seems like cra use typescript and ask you to install a version a typescript above 2.8.0.
npm i -g typescript
should solve the problem

npm install fails while eslint dependency cannot be solved

When I run npm install on a sample project I get the result below
npm install
> #okta/samples-js-vue#0.1.0 postinstall D:\home\projects\trunk\projects\VoiceToText\samples-js-vue
> npm run install-custom-login && npm run install-okta-hosted-login
> #okta/samples-js-vue#0.1.0 install-custom-login D:\home\projects\trunk\projects\VoiceToText\samples-js-vue
> cd custom-login && npm install --allow-root
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
audited 9983 packages in 11.244s
found 554 vulnerabilities (3 low, 14 moderate, 536 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
> #okta/samples-js-vue#0.1.0 install-okta-hosted-login D:\home\projects\trunk\projects\VoiceToText\samples-js-vue
> cd okta-hosted-login && npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
audited 9864 packages in 11.739s
found 551 vulnerabilities (3 low, 14 moderate, 533 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
npm WARN eslint-plugin-eslint-plugin#2.1.0 requires a peer of eslint#>=5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
audited 2069 packages in 35.602s
I then ran >npm audit fix
and got :
npm WARN eslint-plugin-eslint-plugin#2.1.0 requires a peer of eslint#>=5.0.0 but none is installed. You must install peer dependencies yourself.
I've tried installing eslint and eslint-plugin-eslint-plugin but I get the same problem.
Is this an accepted warning?
/D

High severity vulnerabilities after setting up a reactjs project

I'm starting a brand new project with react-js, after installing the project with npm, I get high severity vulnerabilities, how can I fix these vulnerabilities? would it cause any problems?
when I run the command npm start everything seems to work just fine.
I have tried running "npm audit fix" but it says: fixed 0 of 8646 vulnerabilities.
When I run this command:
npx create-react-app my-app
OUTPUT:
npx: installed 91 in 27.693s
Creating a new React app in E:\My project\ReactJS\Training\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
> core-js#2.6.9 postinstall E:\My project\ReactJS\Training\my-app\node_modules\babel-runtime\node_modules\core-js
> node scripts/postinstall || echo "ignore"
> core-js-pure#3.1.4 postinstall E:\My project\ReactJS\Training\my-app\node_modules\core-js-pure
> node scripts/postinstall || echo "ignore"
+ react-dom#16.8.6
+ react#16.8.6
+ react-scripts#3.0.1
added 1411 packages from 726 contributors and audited 902137 packages in 287.343s
found 8646 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
Initialized a git repository.
Success! Created my-app at E:\My project\ReactJS\Training\my-app
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd my-app
npm start
Happy hacking!
After that, I tried running this:
npm audit fix
OUTPUT:
npm WARN #typescript-eslint/eslint-plugin#1.6.0 requires a peer of typescript#* but none
is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/parser#1.6.0 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/typescript-estree#1.6.0 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp#1.1.2 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.14.0 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.0.6 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.0.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
up to date in 10.513s
fixed 0 of 8646 vulnerabilities in 902137 scanned packages
8646 vulnerabilities required manual review and could not be updated
I believe there is nothing to worry about according to gaearon
"This is not a real “vulnerability” in the context of Create React App because it produces static bundles. So it can’t possibly affect you in any way.
The false positive warnings are unfortunate."
EDIT: For me currently is says there are now 0 vulnerabilities

Categories