NPM安装-npm错误!代码EINVALIDTYPE

时间:2019-03-30 01:12:17

标签: angularjs npm gruntjs bower

在清理并设置其他设备的环境后,我面临许多问题。处理图像后,这并不能阻止我构建项目咕unt的声音

npm  install
npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #5: Expected object but got string
npm ERR! typeerror     at inflatableChild     (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\lib\install\inflate-shrinkwrap.js:93:3)
npm ERR! typeerror     at BB.each (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\lib\install\inflate-shrinkwrap.js:55:12)
npm ERR! typeerror     at tryCatcher (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
npm ERR! typeerror     at Object.gotValue (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:155:18)
npm ERR! typeerror     at Object.gotAccum (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:144:25)
npm ERR! typeerror     at Object.tryCatcher (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
npm ERR! typeerror     at Promise._settlePromiseFromHandler (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
npm ERR! typeerror     at Promise._settlePromise (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
npm ERR! typeerror     at Promise._settlePromiseCtx (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:606:10)
npm ERR! typeerror     at _drainQueueStep (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:142:12)
npm ERR! typeerror     at _drainQueue (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
npm ERR! typeerror     at Async._drainQueues (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
npm ERR! typeerror     at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\YouStable\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
npm ERR! typeerror     at processImmediate (timers.js:638:19)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\YouStable\AppData\Roaming\npm-cache\_logs\2019-03-30T00_58_00_673Z-debug.log

1 个答案:

答案 0 :(得分:0)

在将node v6.11.2npm v10.16.3一起使用时,我也遇到了这个问题,
并且几乎想升级到最新版本:(

此问题是由于package-lock.json文件已损坏而引起的,npm install尝试在进行任何新安装之前从中读取/配置依赖关系树。

Best advice that I got实际上是从根文件夹删除package-lock.json 文件。之后,我就能够成功npm install