5

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.

1
  • Can you share the dependencies from your package.json?
    – user835611
    Sep 23, 2018 at 22:47

5 Answers 5

19

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 :)

4

I my case i was able to fix it by deleting

  1. node_modules
  2. package-lock.json

and then running npm install

4

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
0
0

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.