orYoffe/create-react-native-web-app

web command not found

Closed this issue · 6 comments

Describe the bug
web command not found

To Reproduce
Steps to reproduce the behavior:
npx crnwa myApp
cd myApp
yarn web

Expected behavior
It should start the development server

Screenshots
Screenshot 2021-04-18 at 3 35 45 PM
Screenshot 2021-04-18 at 3 36 06 PM

Desktop (please complete the following information):

  • OS: MacOS

Hi @deepansh946
Could you please share the package.json file in the root of the project?

Also please run npx crnwa --version to see which version you have.. if you installed the package globally before it might be an old version

@orYoffe

Package.json
Screenshot 2021-04-18 at 10 56 11 PM

Version
Screenshot 2021-04-18 at 10 57 01 PM

@deepansh946 that's a bit strange since I have it working and the package.json file looks like this:

{
  "name": "myapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "lint": "eslint .",
    "web": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "dependencies": {
    "react": "^17.0.1",
    "react-native": "^0.63.3",
    "react-dom": "^17.0.1",
    "react-native-web": "^0.14.8",
    "react-scripts": "4.0.0",
    "web-vitals": "^0.2.4"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "17.0.1"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

with the same command you shared.

only thing I can think of is maybe there's a limitation since the template package is not included as a dependency of the core package.. I would update and request later for you to check it if you could.

Thanks again for posting.. could you share your nodejs and npm versions? it might be related

@deepansh946 I just release a minor version 0.16.3
should be up shortly, would you please run

npx crnwa --version

to verify you're getting the new version and then if you do get 0.16.3 please try again the steps to reproduce that you mentioned above?

CRNWA Version
Screenshot 2021-04-19 at 7 29 57 PM

Still the same error
Screenshot 2021-04-19 at 7 32 22 PM

npm and node versions
Screenshot 2021-04-19 at 7 30 09 PM

could you try please this command?
npx react-native init MyApp --template react-native-template-react-native-web
this is basically using the react-native cli to start a react native project with a template.. it's also the template we use here in the project.
if it doesn't work I'd suggest posting an issue linking to this one at https://github.com/react-native-community/cli since we're using their cli maybe they would know the reason.

Thanks again for posting