Unable to start server on Linux 18.4 LTS in CockpitCMS-React-Static/react-app demo


#1

Hello Cockpit Community,

Can someone help me and tell me why i can’t start local server when i run yarn install.

When i run yarn start, am getting an error here .

namwanza@Ronnie:/mnt/c/CockpitCMS-React-Static/react-app$ yarn start
yarn run v1.12.3
$ sh -ac '. .env.local; react-static start’
sh: 1: .: .env.local: not found
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here is my package.json

{
“name”: “react-static-cockpit-example”,
“version”: “1.0.1”,
“main”: “index.js”,
“license”: “MIT”,
“scripts”: {
“start”: “sh -ac ‘. .env.local; react-static start’”,
“stage”: “react-static build --staging”,
“build.dev”: “sh -ac ‘. .env.development; react-static build’”,
“build.prod”: “sh -ac ‘. .env.production; react-static build’”,
“bundle”: “react-static bundle”,
“export”: “react-static export”,
“serve”: “serve dist -p 3000”,
“deploy.dev”: “yarn build.dev && rm -rf …/public/html/* && cp -rf dist/* …/public/html/”,
“deploy.prod”: “yarn build.prod && rm -rf …/docs/* && cp -rf dist/* …/docs/”
},
“dependencies”: {
“axios”: “^0.18.0”,
“bootstrap”: “^4.1.3”,
“formik”: “^1.3.1”,
“graphql-request”: “^1.8.2”,
“htmr”: “^0.7.0”,
“leaflet”: “^1.3.4”,
“react”: “^16.0.0”,
“react-dom”: “^16.0.0”,
“react-highlight.js”: “^1.0.7”,
“react-hot-loader”: “^4.0.0-beta.21”,
“react-leaflet”: “^2.1.0”,
“react-player”: “^1.6.6”,
“react-router”: “^4.2.0”,
“react-static”: “^5.9.12”,
“reactstrap”: “^6.5.0”,
“styled-components”: “^3.4.10”
},
“devDependencies”: {
“eslint-config-react-tools”: “1.x.x”,
“serve”: “>=7.0.0”
}
}


#2

Hey @Namwanza, that demo is not part of the official cockpit cms, please open an issue on the github project page - https://github.com/pauloamgomes/CockpitCMS-React-Static/issues
(in such case confirm that you have a .env.local file on the directory, and you have a recent version of node and yarn installed)


#3

Okay thanks Paul for your positive reply !


#4

Though i would like to know the difference in cockpitCMS-React-Static demo and cockpit-react-example ?? Coz i want to use react along side cockpit cms.

Thanks


#5

CockpitCMS-React-Static demo is based on Cockpit and React-Static projects, resuming provides an example of cockpit pre-configured with collections, users and layout components. And an example react application.


#6

So which of the two is best for me to use for my react app that uses cockpitCMS , cockpitCMS-React-Static demo and cockpit-react-example ?

Coz i have tried running cockpitCMS-React-Static since yesterday but seems not to work, in fact am getting an error as mention above Paul …


#7

They are just examples and therefore should be used like that, if you plan to build something its always better to create your own structure.
It should work, did you run yarn install before yarn start?


#8

Oh yes i did that Paul


#9

Open an issue on the github project page with all your details (a screenshot of the error, etc…)


#10

yes i have already opened an issue.

Thanks


#11

ok, I’ll try to check soon.


#12

Thanks Paul. I will be glad !