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

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.xdnf.cn/news/6073.html

相关文章:

  • CS4334:一款高性能的立体声音频数模转换器
  • 如何自定义 Spring MVC 的配置?
  • 【unity游戏开发——编辑器扩展】使用EditorGUI的EditorGUILayout绘制工具类在自定义编辑器窗口绘制各种UI控件
  • 高速数字测试利器,新款是德科技UXR0504B示波器
  • RPA vs. 传统浏览器自动化:效率与灵活性的终极较量
  • STM32 片上资源之串口
  • 《实现模式》以Golang视角解读 价值观和原则 day 1
  • 快速定位到源码位置的插件 - vite/webpack
  • 【Python】普通方法、类方法和静态方法的区分
  • hbase shell的常用命令
  • 双目云台摄像机:双摄安防功能全方位
  • Java运行原理分析
  • LeetCode 热题 100 114. 二叉树展开为链表
  • Spring的bean的生命周期?
  • 【机器学习】支持向量回归(SVR)从入门到实战:原理、实现与优化指南
  • 各大编程语言基本语法区别
  • 游戏引擎学习第279天:将实体存储移入世界区块
  • 为什么 Linux 上默认没有 host.docker.internal
  • 【内网渗透】——NTML以及Hash Relay
  • MySQL Explain 中 Type 与 Extra 字段详解
  • MySQL 服务器配置和管理(上)
  • 监听用户切换浏览器标签页,切换回页面刷新页面
  • 代码随想录算法训练营第60期第三十五天打卡
  • 嵌入式自学第二十天(5.13)
  • AIStarter新功能上线:模型管理与创作者收益系统全面升级,助力AI开发效率提升
  • 函数定义、 异常处理、 迭代器协议、内置函数、返回值
  • WiFi密码查看器打开软件自动获取数据
  • 通用Agent如何评估效果:智能体评测方案AgentCLUE-General(Manus暂时领先)
  • 人形机器人的 9 个分岔口
  • 图灵爬虫练习平台 第十四题 逆向