MINGW64 ~/Downloads/Eshop_mobile_app_react_native (master)
$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: Eshop#1.0.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^18.2.0" from react-dom#18.2.0
npm ERR! node_modules/react-dom
npm ERR! react-dom#"^18.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\PC\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PC\AppData\Local\npm-cache\_logs\2023-01-04T22_30_23_958Z-debug-0.log
I tried running npm install --legacy-peer-deps and tried running $ npx react-native run-android but the build is failing, and I don't know what to do anymore.
MINGW64 ~/Downloads/Eshop_mobile_app_react_native (master)
$ npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1735 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Task :react-native-gradle-plugin:compileJava
> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
> Configure project :lottie-react-native
> Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
C:\Users\PC\Downloads\Eshop_mobile_app_react_native\node_modules\react-native-reanimated\android\react-native-reanimated-68-jsc.aar
Note: C:\Users\PC\Downloads\Eshop_mobile_app_react_native\android\app\src\debug\java\com\eshop\ecommerce\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Get more help at https://help.gradle.org
BUILD FAILED in 48s
at makeError (C:\Users\PC\Downloads\Eshop_mobile_app_react_native\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\PC\Downloads\Eshop_mobile_app_react_native\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\PC\Downloads\Eshop_mobile_app_react_native\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\PC\Downloads\Eshop_mobile_app_react_native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
I'm runnig command :
npm install udev
And I'm getting this error:
npm WARN enoent ENOENT: no such file or directory, open '/home/mitesh/package.json'
npm WARN mitesh No description
npm WARN mitesh No repository field.
npm WARN mitesh No README data
npm WARN mitesh No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! udev#0.6.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the udev#0.6.0 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! /home/mitesh/.npm/_logs/2020-03-16T11_44_35_032Z-debug.log
Looks like you do not have a package.json in your project or it is probably not rightly placed. Here is what you can do;
Browse to your project directory and run this command;
npm init
This should create a package.json file in your project directory
Then run,
npm install udev --save
--save will ensure your module is saved as a dependency in your package.json file.
you could just try to run the last command without the --save but in some cases it helps
Here is a link to further assist: npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'
Try this let me know if it helps.
Trying to troubleshoot an issue, but not sure why out of the blue, I cannot install gulp locally. This is in any folder on my machine.
Here is what I get:
C:\source\portalTest>npm install gulp
npm ERR! code 128
npm ERR! Command failed: C:\app\cmder\vendor\git-for-windows\cmd\git.EXE clone --depth=1 -q -b 1681/head git://github.com/gulpjs/gulp.git C:\Users\Mark\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-3782b653 --config core.longpaths=true
npm ERR! warning: templates not found C:\Users\Mark\AppData\Local\Temp\pacote-git-template-tmp\git-clone-b45c0eb0
npm ERR! warning: Could not find remote branch 1681/head to clone.
npm ERR! fatal: Remote branch 1681/head not found in upstream origin
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mark\AppData\Roaming\npm-cache\_logs\2017-06-02T19_24_16_382Z-debug.log
Anyone know why this happened out of the blue and how to fix this? Have tried npm cache clean and anything else I could find on the internet but nothing worked.
My npm version is 3.10.10
And node version is v7.2.1
And when I tried to install electron in ubuntu via :
sudo npm install electron --save-dev
I get error like this :
Error: read ECONNRESET
at exports._errnoException (util.js:1022:11)
at TLSWrap.onread (net.js:572:26)
npm WARN enoent ENOENT: no such file or directory, open '/home/dotmark/package.json'
npm WARN dotmark No description
npm WARN dotmark No repository field.
npm WARN dotmark No README data
npm WARN dotmark No license field.
npm ERR! Linux 3.13.0-87-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "electron" "--save-dev"
npm ERR! node v7.2.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! electron#1.4.13 postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.4.13 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/dotmark/npm-debug.log
You can't add a module to the dependencies of the package you are writing (--save-dev) unless you first create a package (with npm init or by manually writing a package.json).
… but don't make the root of your package your own home directory. Create a directory for it.
I'm having a stab at learning Node.js and I'm having a few issues when installing NPM (Node Package Manager). I'm pretty sure it's either a permissions thing or folder thing... please note that I've just purchased a Mac (I've used Windows all my life) and I'm pretty unfamiliar with the Mac terminal.
Okay, I went to use the one line install for NPM: curl http://npmjs.org/install.sh | sh and I got an error...
All clean!
! [ -d .git ] || git submodule update --init --recursive
node cli.js rm npm -g -f
node cli.js install -g -f
npm ERR! Could not create /usr/local/lib/node_modules/___npm.npm
npm ERR! error installing npm#1.0.94 Error: EACCESS, Undefined error: 0 '/usr/local/lib/node_modules'
npm ERR! Error: EACCESS, Undefined error: 0 '/usr/local/lib/node_modules'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.0.0
npm ERR! command "node" "/private/var/folders/z2/f05c8hx105g79drh6r7hr01w0000gn/T/npm.1219/package/cli.js" "install" "-g" "-f"
npm ERR! cwd /private/var/folders/z2/f05c8hx105g79drh6r7hr01w0000gn/T/npm.1219/package
npm ERR! node -v v0.5.9-pre
npm ERR! npm -v 1.0.94
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCESS
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/z2/f05c8hx105g79drh6r7hr01w0000gn/T/npm.1219/package/npm-debug.log
npm not ok
make: *** [install] Error 1
npm ERR! Could not create /usr/local/lib/node_modules/___npm.npm
npm ERR! error installing npm#1.0.94 Error: EACCESS, Undefined error: 0 '/usr/local/lib/node_modules'
npm ERR! Error: EACCESS, Undefined error: 0 '/usr/local/lib/node_modules'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.0.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/z2/f05c8hx105g79drh6r7hr01w0000gn/T/npm.1219/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/z2/f05c8hx105g79drh6r7hr01w0000gn/T/npm.1219/package
npm ERR! node -v v0.5.9-pre
npm ERR! npm -v 1.0.94
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCESS
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/z2/f05c8hx105g79drh6r7hr01w0000gn/T/npm.1219/package/npm-debug.log
npm not ok
It failed
there's obviously a folder issue here, perhaps I'm installing in the wrong place, my node folder is at Users/Mike/node, when I try and find out my node path variable using NODE_PATH I get the following error:
Michaels-MacBook-Pro:~ Mike$ node node/NODE_PATH
node.js:203
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/Users/Mike/node/NODE_PATH'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Array.<anonymous> (module.js:470:10)
at EventEmitter._tickCallback (node.js:195:26)
Can someone please tell me what I'm doing wrong? Do I need to add the node path like such:
$ export PATH=/path/to/node/0.n.y/bin:${PATH}
$ curl http://npmjs.org/install.sh | sh
Or am I confusing myself?
The permissions on /usr/local require you to use sudo to install NPM, or change your permissions. Of these three, I recommend the third option.
Option #1: Use sudo
(Note that the the creator of NPM advises against using this method)
curl http://npmjs.org/install.sh | sudo sh
Option #2: Change permissions
sudo chmod g+rwx /usr/local
sudo chgrp admin /usr/local
Option #3: Use Homebrew
I recommend installing Homebrew to manage installing *nix tools on OS X (I'd stay away from MacPorts & Fink). Installing Homebrew will set the permissions for /usr/local so you can write to it without sudo. You can then install Node via Homebrew, and then install NPM normally:
brew install node --without-npm
curl http://npmjs.org/install.sh | sh
Use curl http://npmjs.org/install.sh | sudo sh.
Edit: You're using node -v v0.5.9-pre, which is very unstable. Use 0.4.12, the latest stable version.
if you are using windows , it takes some steps , 1) create a file called package.json
{
"name": "hello"
, "version": "0.0.1"
, "dependencies": {
"express": "*"
}
}
where hello is the name of the package and * means the latest version of your dependency
2) code to you project directory and run the following command
npm install
As update for the method #3 on OSX the correct command now is:
brew install node --without-npm
curl https://www.npmjs.org/install.sh | sh
Option #4:
Install node local to the user that needs it.
I should clarify for my purposes I needed npm to install appium on an OSX server running Bamboo for our integrated testing. I only had macports available and rather than installing homebrew to manage just the one package I decided to build it from source and install it local to the bamboo user. Which allowed us to run appium as the bamboo user and made it possible to run our appium tests on Bamboo as a not very privileged user.
This guide from Tom Novelli goes over how to do it. The basic gist is:
# Make the dir to hold the installation of node
cd
mkdir ./local
mkdir sources
# Tell npm about your new non-default directories
vi .npmrc
cd sources
# Get node and do the typical source install procedure
wget http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz
tar xf node-v0.10.29.tar.gz
cd node-v8.10.29/
# Important part is the --prefix
./configure --prefix=~/.local
make
make install
# Make a link so node doesn't get confused
cd
ln -s .local/lib/node_modules .node_modules
# Edit PATH to include ~/.local
vi .bashrc
.npmrc
root = /home/YOUR-USERNAME/.local/lib/node_modules
binroot = /home/YOUR-USERNAME/.local/bin
manroot = /home/YOUR-USERNAME/.local/share/man
.bashrc OR .profile OR whereever you like setting your path
export PATH=$HOME/.local/bin:$PATH
Useful Links
The .npmrc man page useful.
And just in case here's a link to node source.