当前位置: 首页 > 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) 
http://www.dtcms.com/a/190021.html

相关文章:

  • 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工具类全面指南
  • 深入理解Java适配器模式:从接口兼容到设计哲学
  • 前端最新面试题及答案 (2025)
  • 通过MCP让LLM调用系统接口
  • HTML5 浮动(Float)详解
  • VastBase的日常操作记录
  • 计算机网络:手机和基站之间的通信原理是什么?
  • 解决SQL Server SQL语句性能问题(9)——合理使用表分区
  • Chrome浏览器实验性API computePressure的隐私保护机制如何绕过?
  • 位与运算
  • windows版redis的使用