0

I tried to run an npm install this morning on a React Native 0.53.3 project with "react-navigation": "1.5.11", and I got this error:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/react-navigation/react-native-tab-view@github:react-navigation/react-native-tab-view#36ebd834d78b841fc19778c966465d02fd1213bb" as it does not contain a package.json file.

I thought it would resolve by adding this to my package.json file:

"react-native-tab-view": "^1.3.2",

but I continue to get that same error. I opened a couple of issues with react-navigation team and it got closed as they concluded it is a problem with npm.

How can I resolve this?

It looks like it is referencing this inside of npm-shrinkwrap.json:

"react-native-tab-view": {
      "version": "github:react-navigation/react-native-tab-view#36ebd834d78b841fc19778c966465d02fd1213bb",
      "from": "react-native-tab-view@github:react-navigation/react-native-tab-view#36ebd834d78b841fc19778c966465d02fd1213bb",
      "requires": {
        "prop-types": "^15.6.0"
      }
    },
halfer
  • 19,824
  • 17
  • 99
  • 186
Daniel
  • 14,004
  • 16
  • 96
  • 156
  • try `rm -rf node_modules` and `npm install`. Seems a folder permission issue – HalfWebDev May 30 '19 at 14:18
  • @kushalvm, I continue to get the same error. – Daniel May 30 '19 at 14:31
  • 1
    try deleting all lock files as well. `package-lock.json` or `yarn.lock` if there. – HalfWebDev May 30 '19 at 14:33
  • @kushalvm, I added a little more detail above. The error is referencing the `npm-shrinkwrap.json` – Daniel May 30 '19 at 14:35
  • https://stackoverflow.com/questions/48143945/err-code-enolocal-npm-err-could-not-install-from?rq=1 – HalfWebDev May 30 '19 at 14:37
  • @kushalvm, interesting, I actually do not have a `package-lock.json` file to remove. I am wondering if I should just remove that `react-native-tab-view` from `npm-shrinkwrap.json`, but my concern with that is I also have that package inside of `yarn.lock` file. – Daniel May 30 '19 at 14:42
  • No clue what `npm-shrinkwrap.json` is. – HalfWebDev May 30 '19 at 14:43
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/194187/discussion-between-daniel-and-kushalvm). – Daniel May 30 '19 at 14:44
  • Delete `react-native-navigation` and `react-native-tab-view` from `package.json`. and `rm -rf node_modules` and `npm install` – hong developer May 30 '19 at 15:00
  • @hongdevelop, I tried your recommendation and I get the same error, I am thinking I need to either remove that `react-native-tab-view` from `npm-shrinkwrap.json` first and if that does not work, remove `npm-shrinkwrap.json` altogether and just go with the `package-lock.json` convention. – Daniel May 30 '19 at 15:13

1 Answers1

0

This seems to be an issue with npm-shrinkwrap.json where the error kept referencing the following inside of it:

"react-native-tab-view": {
      "version": "github:react-navigation/react-native-tab-view#36ebd834d78b841fc19778c966465d02fd1213bb",
      "from": "react-native-tab-view@github:react-navigation/react-native-tab-view#36ebd834d78b841fc19778c966465d02fd1213bb",
      "requires": {
        "prop-types": "^15.6.0"
      }
    },

Removing just this did not help, I had to completely remove npm-shrinkwrap.json and do an npm install with just the conventional package-lock.json.

Daniel
  • 14,004
  • 16
  • 96
  • 156