Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm ERR! Object for dependency "@babel/core" is empty

enter image description here

Any idea what to do? I don't have any, other than trying what it says there, "npm install" (which produces exactly the same error...) and googling, and there doesn't seem to be an answer here in stackoverflow.

Your help is appreciated, since I'm a beginner with npm, and overly frustrated month after month...

This is the "complete log" it's referred to in the error:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Daniel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 0f25ee095e558051
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall [email protected]
7 info lifecycle [email protected]~preinstall: [email protected]
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 4777ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 50ms
14 silly install loadShrinkwrap
15 timing stage:rollbackFailedOptional Completed in 1ms
16 timing stage:runTopLevelLifecycles Completed in 4937ms
17 silly saveTree [email protected]
18 verbose stack Error: Object for dependency "@babel/core" is empty.
18 verbose stack Something went wrong. Regenerate the package-lock.json with "npm install".
18 verbose stack If using a shrinkwrap, regenerate with "npm shrinkwrap".
18 verbose stack     at C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\lib\install\inflate-shrinkwrap.js:60:29
18 verbose stack     at tryCatcher (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
18 verbose stack     at Object.gotValue (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:155:18)
18 verbose stack     at Object.gotAccum (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:144:25)
18 verbose stack     at Object.tryCatcher (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
18 verbose stack     at Promise._settlePromiseFromHandler (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:517:31)
18 verbose stack     at Promise._settlePromise (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:574:18)
18 verbose stack     at Promise._settlePromiseCtx (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:611:10)
18 verbose stack     at _drainQueueStep (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:142:12)
18 verbose stack     at _drainQueue (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
18 verbose stack     at Async._drainQueues (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
18 verbose stack     at Immediate.Async.drainQueues (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
18 verbose stack     at processImmediate (internal/timers.js:461:21)
19 verbose cwd C:\Users\Daniel\Programming\Creative React-Redux\Chapter 3\react-player
20 verbose Windows_NT 10.0.19041
21 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Daniel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
22 verbose node v14.15.2
23 verbose npm  v6.14.9
24 error Object for dependency "@babel/core" is empty.
24 error Something went wrong. Regenerate the package-lock.json with "npm install".
24 error If using a shrinkwrap, regenerate with "npm shrinkwrap".
25 verbose exit [ 1, true ]

Thank you.

like image 640
Daniel Tkach Avatar asked Dec 31 '20 06:12

Daniel Tkach


3 Answers

Solution:

These steps generally work for most people:

Step 1. Delete -lock.json file.

Step 2. Run, npm install

Step 3. Run, npm install @babel/core --save

like image 138
Santosh Kumar Avatar answered Oct 27 '22 22:10

Santosh Kumar


I fixed it like this:

  1. Delete node_modules folder
  2. Delete package-lock.json
  3. Run "npm install" in the console
like image 31
Eric Lehmann Avatar answered Oct 27 '22 22:10

Eric Lehmann


You can fix this problem in two simple steps.

  1. Delete node modules & package-lock.json completely.
  2. Run the command npm install from the terminal.

I believe, now you can install new external package.

like image 43
Mahabub Azam Avatar answered Oct 27 '22 21:10

Mahabub Azam