当前位置: 首页 > news >正文

npm install 报错

1、protobufjs@7.4.0 postinstall: node scripts/postinstall verbose stack Error: protobufjs@7.4.0 postinstall: node scripts/postinstall

确认是否有postinstall# node scripts/postinstallCannot find module '/home/rio/scripts/postinstall'

解决办法:

# 添加忽略参数
npm install @vue/cli -g --ignore-scripts
npm install protobufjs -g --ignore-scripts
npm install --save @opentelemetry/auto-instrumentations-node -g --ignore-scripts

2、ENOENT: no such file or directory, open ‘/usr/local/package.json’

在这里插入图片描述

解决方法:

不能使用在root用户目录部署
到普通用户目录下,执行 npm init ,全默认即可,再执行npm install就正常了

[root@rio-accessgate rio]# npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.See `npm help init` for definitive documentation on these fields
and exactly what they do.Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.Press ^C at any time to quit.
package name: (rio) 
version: (1.0.0) 
description: 
entry point: (index.js) 
test command: 
git repository: 
keywords: 
author: 
license: (ISC) 
About to write to /home/rio/package.json:{"name": "rio","version": "1.0.0","description": "","main": "index.js","scripts": {"test": "echo \"Error: no test specified\" && exit 1"},"author": "","license": "ISC"
}Is this OK? (yes) 

相关文章:

  • CMD(Command Prompt)和 Anaconda 的不同
  • c# 倒序方法
  • 数据结构(八)——查找
  • 2025-5-14渗透测试:利用Printer Bug ,NTLMv2 Hash Relay(中继攻击),CVE-2019-1040漏洞复现
  • 环境配置与MySQL简介
  • css设置文字两端对齐text-align:justify不起作用的解决方法
  • C++之fmt库介绍和使用(1)
  • 【数据分析】从TCGA下载所有癌症的多组学数据
  • 【SSL证书系列】SSL证书工作原理解读
  • 开发者的测试复盘:架构分层测试策略与工具链闭环设计实战
  • 【电路笔记 通信】8B/10B编码 高速数据传输的串行数据编码技术 论文第三部分 The 8B/10B coding map
  • 论文查询的ai工具 —— SCAICH
  • ISP有感自发
  • 数据结构基础排序算法
  • MCP(一)——QuickStart
  • JS中的数据类型
  • 计算机视觉----基础概念、卷积
  • 【Docker】Windows10环境下安装DockerDesktop
  • Spring Boot requestBody postman
  • Math工具类全面指南
  • 泽连斯基:正在等待俄方确认参加会谈的代表团组成
  • 马上评|“衣服越来越难买”,对市场是一个提醒
  • 2025年中国网络文明大会将于6月10日在安徽合肥举办
  • 媒体:“西北大学副校长范代娣成陕西首富”系乌龙,但她的人生如同开挂
  • 安徽省委副秘书长、省委政研室主任余三元调任省社科院院长
  • 从这些电影与影像,看到包容开放的上海