npm - npm 错误!代码 ERR_INVALID_ARG_TYPE npm install 时出错
问题描述
我将我的项目克隆到 ubuntu 服务器中进行部署,但是当我尝试安装依赖项时,我遇到了最大调用堆栈大小超出错误。然后按照stackoverflow上的答案我删除了节点模块和package.json。但是现在当我执行 npm install 时,我遇到了以下错误。
npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! errno ERR_INVALID_ARG_TYPE
npm ERR! request to https://registry.npmjs.org/@material-ui%2fcore failed, reason: The "msecs" argument must be of type number. Received type string ('600001')
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ute/.npm/_logs/2021-07-20T08_00_38_282Z-debug.log
当我执行 npm update -g 时也会出现相同类型的错误
npm ERR! request to https://registry.npmjs.org/npm failed,
reason: The "msecs" argument must be of type number. Received type string ('600001')
解决方案
您不应该删除 package.json 文件,因为该文件包含依赖项的必要详细信息作为模块和其他数据。
您可以npm init
在您的特定目录中创建一个 package.json 文件,然后使用此命令安装您的模块npm i -S [your_dependency]
推荐阅读
- java - java:在一个变量上使用 volatile VS 每个变量
- php - 使用php将文件上传到表单需要什么?
- java - 为什么我的由 Spring Data 和 Hibernate 生成的准备好的语句为“null”?
- java - 在 FCM 通知后台发送 JSON
- java - BottomNavigationView 与 RecycleView 的最后一项重叠
- excel - 为什么不是所有的记录都从数据中返回
- regex - 如何为 Safari 创建正则表达式
- javascript - 有没有办法在 JSON 中转换 JS 数组或在 Android 中转换数组?
- c# - DataTrigger 在 RadioButton IsChecked 时更新 DatePicker
- node.js - 如何使用 aws-sdk 将文件同步上传到 S3?