npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Problems with the "npm i moment"

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@0. I’ll try to do my best with it!
npm ERR! typeerror Error: Argument #5: Expected object but got string
npm ERR! typeerror at inflatableChild (C:\Program Files\nodejs\node_modules\npm\lib\install\inflate-shrinkwrap.js:93:3)
npm ERR! typeerror at BB.each (C:\Program Files\nodejs\node_modules\npm\lib\install\inflate-shrinkwrap.js:55:12)
npm ERR! typeerror at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
npm ERR! typeerror at Object.gotValue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\reduce.js:155:18)
npm ERR! typeerror at Object.gotAccum (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\reduce.js:144:25)
npm ERR! typeerror at Object.tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
npm ERR! typeerror at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
npm ERR! typeerror at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
npm ERR! typeerror at Promise._settlePromiseCtx (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:606:10)
npm ERR! typeerror at _drainQueueStep (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:142:12)
npm ERR! typeerror at _drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
npm ERR! typeerror at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
npm ERR! typeerror at Immediate.Async.drainQueues [as _onImmediate] (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
npm ERR! typeerror at runCallback (timers.js:705:18)
npm ERR! typeerror at tryOnImmediate (timers.js:676:5)
npm ERR! typeerror at processImmediate (timers.js:658:5)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\conta\AppData\Roaming\npm-cache_logs\2019-07-21T17_43_06_821Z-debug.log

I was able to install moment without errors. Do you see the same issue if you try installing moment in a new project? (I am wondering if it is a problem with the package you are adding to, with an old package-lock or shrinkwrap format. )