'expo' is not recognized as an internal or external command

后端 未结 15 1030
余生分开走
余生分开走 2020-12-30 01:12

After running npm install -g expo-cli and successfully installing the packages globally, expo is still not recognized as an internal or external co

15条回答
  •  一向
    一向 (楼主)
    2020-12-30 01:43

    If you need a solution to Run Expo command without Environment Variable update then on your terminal use below command for windows system:

    R:\> C:\Users\{user}\AppData\Roaming\npm\expo.cmd init {projectname}
    

    Where you directly point the expo.cmd file rather than specifying in the environment variable.

    And update the expo to C:\Users{user}\AppData\Roaming\npm\expo.cmd in package.json to run the project.

    // package.json
    "scripts": {
        "start": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd start",
        "android": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd start --android",
        "ios": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd start --ios",
        "web": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmdstart --web",
        "eject": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd eject"
      },
    

提交回复
热议问题