i want to install expo-cli on my windows 10 to start a new react native project : i have node js installed with version v10.15.0 but when i enter : "npm install -g expo-cli" but some issus and this are the kind of errors that appears after the installation
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.22.1 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.22.1 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\sami_\AppData\Roaming\npm-cache_logs\2019-05-21T18_38_29_235Z-debug.log
For me, I used yarn instead of npm.
yarn global add sharp
Then
yarn global add expo-cli
After that, if you run
expo
And got
expo is not a command
Which means you need to
add yarn global packages to the envirmonment variable. And your yarn global packages might in C:\Users\username\AppData\Local\Yarn\bin.
Also, I installed python 2.7 in the beginning. Not sure if it helps.
After wasting almost 1 day, I resolved this issue, this error is due to sharp
If you are having issues during installation consider removing the directory C:\Users[user]\AppData\Roaming\npm-cache_libvips
npm install -g sharp # (The installation require python 2.7 on windows and path env configuration)
npm install -g expo-cli
Deleting the expo-cli folder in AppData\Roaming\npm\node_modules then reinstalling expo worked for me.
Related
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.
I am very new to react native and nodejs . Today I installed nodejs on my Elementary Os and installed npm and npx. Now when I try to run npx create-react-app myApp i am getting the following error :
npm ERR! cb.apply is not a function npm ERR! A complete log of this
run can be found in: npm ERR!
/home/user/.npm/_logs/2021-04-29T08_55_29_599Z-debug.log Install for [
'create-react-project#latest' ] failed with code 1
I found some answers on stack overflow but they didn't solve this. Any help would be much appreciated.
npx version:10.2.2
npm version: 7.10.0
node version :16.0.0
I finally solved the error and i am going to keep this thread open if anyone else faces the same problem.
By default, npm installs packages in the local node_modules/ directory. Since npm i npm is shorthand for npm install npm, it will install the latest version of npm locally.
However, when run npm in a shell, the shell picks up the npm in your $PATH, which is probably the global installation.
To update the global installation of npm, run:
npm install --global npm
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".
i´m new in web development. I´m getting this Error Message after running the command: npm install.
May somebody can help me.
Message:
PS C:\Users\Giu\node_modules\npm> npm install
npm WARN deprecated coffee-script#1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
> npm#6.4.1 prepare C:\Users\Giu\node_modules\npm
> node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc
up to date in 4.661s
Der Befehl "rimraf" ist entweder falsch geschrieben oder
konnte nicht gefunden werden. English: The command "rimraf" is either wrong written or it cant be find.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! npm#6.4.1 prepare: `node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the npm#6.4.1 prepare 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\Giu\AppData\Roaming\npm-cache\_logs\2018-10-16T06_40_26_185Z-debug.log
Message end
Thank you!
In order to install npm download node.js it will be already installed with it.
CLICK HERE
To download dependencies from package.json use npm install or npm i.
To make depencies use initially type npm init ,and fill the sufficient details to make your project dependency.
to install npm download node.js and npm will also be installed check this link
then you can install angular cli globally like this npm install -g #angular/cli#latest
then you create angular project using this command ng new projectNameand also check this link
then move to project folder cd projectName
then install all the project dependencies from package.json using npm install
then finally you can run the project and run on browser using ng serve --open
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.