Cannot determine which native SDK version your project uses because the module `expo` is not installed - node.js

When I run npm start in powershell is shows the following error error:
PS C:\Users\UTKARSH\Desktop\react_native\my_project> npm start
# start C:\Users\UTKARSH\Desktop\react_native\my_project
expo start
Starting project at C:\Users\UTKARSH\Desktop\react_native\my_project
Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
ConfigError: Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
at Object.getExpoSDKVersion (C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Project.ts:22:9)
at ensureConfigHasDefaultValues (C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:419:22)
at fillAndReturnConfig (C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:101:10)
at getConfig (C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:137:10)
at configureProjectAsync (C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:288:25)
at action (C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:164:34)
at C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:341:16
at Command.<anonymous> (C:\Users\UTKARSH\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:82:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start 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! C:\Users\UTKARSH\AppData\Roaming\npm-cache\_logs\2020-05-15T07_09_48_901Z-debug.log
PS C:\Users\UTKARSH\Desktop\react_native\my_project> clear
How can I fix this?

I just had this problem. I solved it like this:
I was using old Node version with NVM. I changed to the last node version
nvm use 12.x.x
with nvm and updated:
yarn global add expo-cli
but, you need run
npm install expo-cli --global
for npm. After that, I changed back to the old version:
nvm use 10.x.x
and ran
yarn start
or
npm start
This solved the issue.

I had that problem. I installed yarn and then ran the command "yarn add expo".

Related

Installing dependencies with npm-peer-dependencies

I am trying to install the required node_modules for a small project running Angular 11 using npm install
My goal is get the project to work locally after downloading it from GitHub. I have already installed the latest version of the Angular CLI.
After running the install command I tried npm start.
I was expecting that after running the install and start command to be able to run the project locally.
However the actual result I get after running the install command is the following list of errors:
> ng serve
An unhandled exception occurred: Cannot find module '#angular/compiler'
Require stack:
\node_modules\#angular\compiler-cli\index.js
\node_modules\#ngtools\webpack\src\angular_compiler_plugin.js
\node_modules\#ngtools\webpack\src\index.js
\node_modules\#angular-devkit\build-angular\src\webpack\configs\typescript.js
\node_modules\#angular-devkit\build-angular\src\webpack\configs\index.js
\node_modules\#angular-devkit\build-angular\src\browser\index.js
\node_modules\#angular-devkit\build-angular\src\dev-server\index.js
\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js
\node_modules\#angular-devkit\architect\node\index.js
\node_modules\#angular\cli\models\architect-command.js
\node_modules\#angular\cli\commands\serve-impl.js
\node_modules\#angular-devkit\schematics\tools\export-ref.js
\node_modules\#angular-devkit\schematics\tools\index.js
\node_modules\#angular\cli\utilities\json-schema.js
\node_modules\#angular\cli\models\command-runner.js
\node_modules\#angular\cli\lib\cli\index.js
\node_modules\#angular\cli\lib\init.js
\node_modules\#angular\cli\bin\ng
See "angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file C:\WINDOWS\system32\cmd.exe
npm ERR! errno ENOENT
npm ERR! `ng serve`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the #0.0.16 start 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:
The problem is that this Angular project also has peer dependencies. I installed npm-install-peers package but it seems that simply running npm install afterwards will not install the required peer dependencies.
What should I do next to get this Angular project installed locally ?
The issue you are facing is likely because angular cli or npm-peer-dependencies are not installed globally on your machine.
The steps that you should take are to make sure of them are globally installed.
To install packages globally you need run npm install -g <package_name>
npm docs link
In your case for angular cli you should run
npm i -g #angular/cli#11.2.15 and npm install -g npm-peer-dependencies.
Then run npm start.

Can't start react native project with npm start

First i started with installing npm (version ) then expo cli (version ) then i initialise a project normaly then when i start my project with npm start and also expo start a get this message :
Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
ConfigError: Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
at Object.getExpoSDKVersion (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Project.ts:22:9)
at ensureConfigHasDefaultValues (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:419:22)
at fillAndReturnConfig (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:101:10)
at getConfig (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:137:10)
at configureProjectAsync (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:288:25)
at action (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:164:34)
at C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:341:16
at Command.<anonymous> (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:82:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: expo start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start 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! C:\Users\BILAL\AppData\Roaming\npm-cache_logs\2020-05-17T00_34_22_028Z-debug.log
also i worked with react native and react-cli before for a simple app and it worked but this time i tried for a week without result
thank you so much

Expo project not starting

My expo project doesn't start when I try to use npm start.
Versions that I am using are
Expo-cli: 3.20.5
Node : 12.16.3
Flow:
expo init project
-> blank template
expo start
After running the expo start command it gives the following error
Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
ConfigError: Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
at Object.getExpoSDKVersion (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Project.ts:35:9)
at ensureConfigHasDefaultValues (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:419:22)
at fillAndReturnConfig (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:101:10)
at configureProjectAsync (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:281:25)
at action (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:157:34)
at C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:334:16
at Command.<anonymous> (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:85:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Then as mentioned in the above first line I ran npm install expo
After running the command for installing expo it gives me the following error
Error: React Native is not installed. Please run `npm install` in your project directory.
Couldn't start project. Please fix the errors and restart the project.
at startExpoServerAsync (C:\#expo\xdl#57.9.5\src\Project.ts:2080:11)
at Object.startAsync (C:\#expo\xdl#57.9.5\src\Project.ts:2397:5)
at action (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:170:3)
at C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:341:16
at Command.<anonymous> (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:85:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR! Failed at the # start script.
Then I ran npm install mentioned in the above error but then got this error
npm WARN deprecated deep-assign#3.0.0: Check out `lodash.merge` or `merge-options` instead.
npm WARN deprecated core-js#1.2.7: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
after that when i again try to npm start it keeps repeating itself through the same errors I mentioned above
the problem is that npm install is not working on your machine, possibly due to some cache issues. you can run npm cache clean --force and then npm install again to try to resolve the issue
Illustration I had the same issue and cleaned up my node module. But the issue came back because I kill my server the wrong way. So I cleaned the repo again and close my server properly. And now I all the time close correctly my server. The issue didn't happen again for the moment.
=> Don't kill your cmd, you have to close the server correctly by doing CMD+C for win 10.

Cypress installation failed

I installed nodejs and npm on windows 10. Than I tried to install cypress via npm install cypress --save-dev and get the following Error:
> node index.js --exec install
The command "node" is either misspelled or
could not be found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress#3.8.2 postinstall: `node index.js --exec install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cypress#3.8.2 postinstall 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! C:\Users\U\AppData\Roaming\npm-cache\_logs\2020-01-21T11_05_01_566Z-debug.log
After this I added the path %USERPROFILE%\AppData\Local\Temp to my system environment variables. But I get this error messages again. How can I fix this problem?
try the following steps :
install git on your machine and config it as global.
delete old package.js then re-init new package.
try again cypress install command
Try this instead by installing the previous version but Explicitly: npm install cypress#8.1.0 --save-dev
Download it in the any directory its a hack to download, if your proxy is properly configured and internet speed is good. it will download while doing npm install
wget https://cdn.cypress.io/desktop/7.6.0/win32-x64/cypress.zip
Provide the zip location
CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip npm install cypress
Remember to actually run the npm command inside your folder with the package.json.
Delete the package.json.
Again re build the package by npm init.
Install Cypress again by using npm install cypress --save-dev.

node-sass installation issue on windows 10

I have installed node js latest version(8.8.1) and npm latest version(5.5.1)
and when i try to install node-sass i get this:
npm install -g node-sass
C:\Users\Giannis\AppData\Roaming\npm\node-sass -> C:\Users\Giannis\AppData\Roaming\npm\node_modules\node-sass\bin\node-sass
node-sass#4.5.3 install C:\Users\Giannis\AppData\Roaming\npm\node_modules\node-sass
node scripts/install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.5.3 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.5.3 install 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! C:\Users\Giannis\AppData\Roaming\npm-cache_logs\2017-10-26T11_57_10_751Z-debug.log
I have set the system variable
C:\Program Files\nodejs\
Thanks
node-sass requires node-gyp https://github.com/sass/node-sass#install
node-gyp requires windows-build-tools https://github.com/nodejs/node-gyp#on-windows
Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).
Using the npm install --global --production windows-build-tools on an Elevated prompt works for me. The installer got stuck on visual studio build tools, but they were already installed on my system. So i ctrl +c the npm install process and run it once again. This time a messages shows up that the build tools are already installed and the installation will be skipped and continued with python configuration.
Finally the node-sass installation completed successfully.
BTW node-sass usage is deprecated and will be removed. The suggestion is to start using sass.

Resources