I am trying to run example code for React Stock chart
https://github.com/rrag/react-stockcharts
The examples are in
https://github.com/rrag/react-stockcharts-examples2
I am new to npm and js and I want to run some examples to learn.
I got correct npm version and node js version but still I got some problem.
npm ERR! peerinvalid The package eslint-plugin-jsx-a11y#5.0.1 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer eslint-config-react-app#1.0.5 wants eslint-plugin-jsx-a11y#^5.0.3
I looked at package-lock.json and changed eslint-plugin-jsx-a11y#5.0.1 to 5.0.3 and still no luck.
Also, this is how package.json looks like.
{
"name": "react-stockcharts-example",
"description": "",
"version": "0.0.24",
"dependencies": {
"d3-dsv": "1.0.5",
"d3-format": "^1.2.0",
"d3-scale": "1.0.6",
"d3-time-format": "2.0.5",
"prop-types": "15.5.10",
"react": "15.5.3",
"react-dom": "15.5.3",
"react-stockcharts": "0.7.0-beta.12"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Thank you for your help.
Related
I have created the react application using npx create-react-app task-tracker and this is my package.json file when ever I run npm start it shows error. As I am new to React I hardly have any knowledge about it.
this the error:
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2021-04-19T15_13_05_651Z-debug.log
package.json:
{
"name": "task-tracker",
"version": "0.1.0",
"private": true,
"dependencies": {
"cra-template": "1.1.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-scripts": "4.0.3"
}
}
It seems like create-react-app did not add the "scripts" field to the package.json object. I would try adding this field to package.json
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
If that doesn't work, try running create-react-app again
In reactJs after run
npm start
it gives
./src/index.js Module not found: Can't resolve 'react' in
'C:\Users...\src'
error.
this is my package.js
{
"name": "client-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"#aspnet/signalr": "^1.0.4",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-scripts": "^1.1.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Try removing package-lock.json, run npm install and then run npm start again.
I had to create a docs in order to see my react page displaying on github pages. I used h-pages deploy and keep getting this error when I am attempting to update the gh-pages.
The only branch I can access is *master.
I was doing :
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
this is the error :
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rReduxTable#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rReduxTable#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marianaperez/.npm/_logs/2018-03-12T19_02_15_196Z-debug.log
this is my json package
{
"name": "rReduxTable",
"version": "0.1.0",
"private": true,
"devDependencies": {
"gh-pages": "^1.1.0",
"husky": "^0.14.3",
"lint-staged": "^7.0.0",
"prettier": "^1.11.0",
"react-scripts": "^1.0.17"
},
"dependencies": {
"debug": "^3.1.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "next",
"react-sortable-table": "^1.3.0",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"sanitize.css": "^5.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"precommit": "lint-staged",
"predeploy": "npm run build",
"deploy": "gh-pages -b master -d build"
},
"homepage": "https://marianapt.github.io/reduxTable/",
"lint-staged": {
"*.{js,json,css,md}": [
"prettier --write",
"git add"
]
}
}
When I try to deploy my React app (made with create-react-app) to Heroku (using create-react-app-buildpack) I get the following error:
Failed to compile.
Module not found: Error: Can't resolve 'jquery' in
'/tmp/build_049d73accaf035b451adf36ac44318d3/src/components'
npm ERR! Linux 3.13.0-128-generic
npm ERR! argv
"/tmp/build_049d73accaf035b451adf36ac44318d3/.heroku/node/bin/node"
"/tmp/build_049d73accaf035b451adf36ac44318d3/.heroku/node/bin/npm" "run"
"build"
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! life-quality-data#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
When testing on my computer everything works. I also have jQuery added as a dependency in package.json:
{
"name": "life-quality-data",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.16.2",
"dns": "^0.2.2",
"fetch": "^1.1.0",
"jquery": "^3.2.1",
"node-sass-chokidar": "0.0.3",
"numeral": "^2.0.6",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-router-dom": "^4.2.2",
"react-scripts": "1.0.12",
"xml2js": "^0.4.19"
},
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
I think I might be missing a line. Also, could it be the .gitignore? Because on GitHub the node modules are being ignored.
I'm trying to implement react-navigation into an app made using create-react-native-app. The problem is after installing the npm module (or any other) nothing works. I get build error like undefined is not an object (evaluating 'ReactPropTypes.string').
Googled and followed issues on github and still haven't found a solution. Could some one help me out please?
package.json
{
"name": "TestApp",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "~1.0.1",
"react-native-scripts": "0.0.31",
"react-test-renderer": "16.0.0-alpha.6"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^17.0.0",
"react": "^16.0.0-alpha.6",
"react-native": "^0.45.0",
"react-navigation": "^1.0.0-beta.11"
}
}
yarn v0.24.5
npm v3.10.10
Mac OSX Sierra 10.12.5
It looks like a version mis-match between react and react-native. Installing react-native#"0.45.1" with react#"16.0.0-alpha.12" fixed this for me.