Reputation: 759
When I run npm install
, I getting the following error,
npm WARN tar ENOENT: no such file or directory, open 'D:\Live Project\insyte-mobile\insyte-mobile\node_modules.staging\core-js-c9f4d03d\library\fn\symbol\unscopables.js'
Here is a screen shoot of the error
:
Here is my package.json
{
"name": "tonight-mobile",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "~27.0.0",
"react-test-renderer": "16.3.1"
},
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"eject": "expo eject",
"initial-android": "npm install && npm run android",
"initial-ios": "npm install && npm run ios",
"android": "expo start --android",
"ios": "expo start --ios",
"test": "jest",
"postinstall": "rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"axios": "^0.18.0",
"expo": "^32.0.0",
"expo-image-picker": "^5.0.2",
"firebase": "^5.7.1",
"firebase-admin": "^8.5.0",
"firebase-functions": "^3.2.0",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-native-firebase": "^5.1.1",
"react-native-image-crop-picker": "^0.21.3",
"react-native-image-picker-form": "^0.2.5",
"react-native-maps": "^0.21.0",
"react-native-responsive-image": "^2.3.1",
"react-native-swiper": "^1.5.14",
"react-native-vector-icons": "^5.0.0",
"react-navigation": "^2.13.0",
"react-navigation-tabs": "^1.0.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-persist": "^5.10.0",
"redux-persist-filesystem-storage": "^1.3.2",
"redux-thunk": "^2.3.0",
"tcomb-form-native": "^0.6.20"
}
}
above is the package.json file.
I have also used another code of this project, but this time I'm getting following error :
Upvotes: 36
Views: 125625
Reputation: 864
The "solutions" in anything I found online are not actually solutions
I Followed these steps.
Delete package-lock.json works but is a very weak workaround as the package-lock.json is an important file that shouldn't need to be deleted.
Follow the below command
rm -rf node_modules && npm cache clean --force
npm i
.Upvotes: 2
Reputation: 92
My simple solution for this error:
"npm WARN tar ENOENT:no such file or directory
Not only for ENOENT if all files in npm modules shows this kinds of error.
npm -v
)npm init
and click on enter for whatever it asksUpvotes: 2
Reputation: 37
npm ERR! code ENOENT npm ERR! syscall open npm ERR! path E:\Projects\package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'E:\Projects\package.json' npm ERR! enoent This is related to npm not being able to find a file.
Solution ==> Check the root directory you might be outside the root directory or in wrong folder path has been opened
Upvotes: -1
Reputation: 31
Follow this step:
npm cache clean -force
npm install
(if the issue is not yet fixed try the following 4th step.)npm install -g npm
,then npm install
npm start
Upvotes: 2
Reputation: 125
I suspect you do not have git installed on your computer. This is particularly true if you are getting this error at the bottom of your log:
npm ERR! syscall spawn git
If so, then you need to install git from here: https://git-scm.com/downloads.
I had the same problem as you, and once I installed git, the problem went away.
Upvotes: -2
Reputation: 2014
Check the node version, if the application was build using an older node version then you can downgrade your local environment node version using NVM (node version manager).
Upvotes: 0
Reputation: 869
All you need to do is
Open a terminal in your pc's root and run this command:
killall node
Before restart the new metro bundler please reinstall the dependencies on yarn or npm :
npm i OR yarn
Also the article: ENOENT: no such file
Upvotes: 5
Reputation: 185
Please check your current working directory. if you have created project using npx react-native init demo
then navigate inside project from terminal using cd demo npm install
will install all npm modules and you can also check installed packages in the directory: demo/node_modules
also if project is expo base then run expo eject to eject from expo
Upvotes: 0
Reputation: 317
Delete node_modules folder and package-lock.json, then run npm install
Upvotes: 11
Reputation: 67
Do you have a package.json file in the folder ?*
To run npm install you need to have a package.json file.
Upvotes: -3