angularjs - NPM 安装 - npm 错误!代码 EINVALIDTYPE
问题描述
在其他设备中清理和设置环境后,我面临很多问题。它不允许我构建我的项目 grunt build 在处理图像后卡住了
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
解决方案
在使用node v6.11.2
with 时npm v10.16.3
,我也遇到了这个问题,
几乎想升级到最新版本:(
该问题是由于文件有些损坏而导致的,该package-lock.json
文件npm install
试图在任何新安装之前读取/配置依赖关系树。
我得到的最佳建议是从根文件夹中实际删除 package-lock.json文件。在那之后,我能够npm install
成功。
推荐阅读
- reactjs - 减速器未执行
- javascript - 手机屏幕上的菜单有问题
- angular - Angular Material 微调器不适用于同步调用
- nuget - Squirrel 中的 NuGet 框架定位
- javascript - 调整窗口大小后移动导航下拉菜单不会消失
- android - 添加回溯在 WebRTC 上不起作用
- regex - 使用正则表达式的 Angular 响应式表单中的模式验证器
- c# - 从控制台应用程序引用时,静态文件不适用于 AspNetCore Web 应用程序
- c# - 如何使用 Chart.js 中的 ChartBar 和 Bootstrap 4 中的警报对齐元素?
- apache-spark - spark 3.0 中的 glob