2

I have this react-native project I worked on my other pc, and I want now to keep working on this exact project folder in my other linux machine.

So now I have the project folder, which doesn't contain node_modules directory, but it does contain "package.json". As I understood it, doing NPM install inside the directory, should install and create the node_modules directory with all the needed dependencies. However, the operation is failed after a while with the error "npm ERR! cb() never called!"

I've already tried to clean npm cache (with -f flag) but it doesn't worked for me. I'm running on Ubuntu 18.04 based os with Node.js v8.10.0 and npm v3.5.2.

Optimize
  • 63
  • 1
  • 1
  • 6

5 Answers5

16

In my case, I had an own custom node_module which is in my package.json like that:

// ...
"dependencies": {
    // ...
    "my-module": "file:../../my-module",
},
// ...

This package is only available in a specific environment (dynamically added to package.json via npm install ../../my-module), which is by intend, but I forgot about it and when I ran npm install in another environment (where my module was not available) the mysteriuos cb() never called error occured.

After putting the option --no-package-lock behind the npm install the error got more clear, telling me that it has something to do with my-module.

see also: https://stackoverflow.com/a/52474959/3063191

Hope this helps :)

jlang
  • 743
  • 8
  • 24
1

I had similar issue for git project. The Project configuration had created bad .npmrc file, which was preventing package installation. I resolved it by deleting the .npmrc file, then performing hte following steps:

  1. Delete the node_modules folder from project, if it exists
  2. Delete temp files from machine
  3. Run npm cache clean --force
  4. Run npm install
DDriggs00
  • 27
  • 8
kumar chandraketu
  • 1,546
  • 2
  • 13
  • 20
0

I my case i was able to fix it by deleting

  1. node_modules
  2. package-lock.json

and then running npm install

geekbro
  • 1,035
  • 10
  • 10
0

Manually delete the package-lock.json file and then run "npm install". It should re-generate the package-lock.json.

IDrumsey
  • 1
  • 4
0

let me save your time , Just install latest Nodejs. I was trying all day. Finally this solved