0

I am new to React and whenever I try to deploy the application I am getting the following error

npm WARN [email protected] 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: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

This is my package.json file for the reference. Please review this and help me with the solution. I have just removed my actual username form the homepage.

{
  "name": "e-store",
  "version": "0.1.0",
  "private": true,
  "homepage": "https://username.github.com/e-store.git",
  "dependencies": {
  "@testing-library/jest-dom": "^4.2.4",
  "@testing-library/react": "^9.5.0",
  "@testing-library/user-event": "^7.2.1",
   "react": "^16.13.1",
   "react-dom": "^16.13.1",
   "react-scripts": "3.4.1",
   "save-dev": "0.0.1-security"
  },
  "scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject",
  "predploy": "npm run build",
  "deploy": "gh-pages -d build"
 },
 "eslintConfig": {
  "extends": "react-app"
 },
 "browserslist": {
 "production": [
 ">0.2%",
 "not dead",
 "not op_mini all"
 ],
 "development": [
  "last 1 chrome version",
  "last 1 firefox version",
  "last 1 safari version"
  ]
},
"devDependencies": {
  "gh-pages": "^2.2.0",
  "typescript": "^3.9.2"
 } 
}

1 Answer 1

1

run the following command and this should be fixed.

npm install typescript --save-dev

Update: make sure you include the following script in your package.json

"scripts": {
  "predeploy": "npm run build",
  ... //other scripts
}
Sign up to request clarification or add additional context in comments.

3 Comments

I am still not able to deploy. Getting following error: ENOENT: no such file or directory, stat 'C:\e-store\build' npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] deploy: gh-pages -d build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] deploy script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Can you share your package.json scripts section?
Thanks @Skoltz. Problem was with the spell mistake.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.