zoukankan      html  css  js  c++  java
  • 使用--ignore-scripts解决npm/yarn安装依赖失败问题

    npm安装报错问题一:

    最近使用npm安装依赖频繁遇到安装失败的问题,报错如下

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! fibers@4.0.3 install: `node build.js || nodejs build.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the fibers@4.0.3 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     D:Program FilesJavaScript
    odejs-14.17.6
    ode_cache\_logs2021-09-29T04_09_38_618Z-debug.log

    解决方案

     npm install fibers@4.0.3 --ignore-scripts

    清除公司私服的temp目录
    一般人都不会这么干

    原因探究
    公司私服代理阻止了依赖的正常安装,或者是你本地的脚本文件异常导致了依赖安装失败(上方报错信息中的./scripts/checkYarn.js)

    npm安装报错问题二:

    Error:npm ERR! Failed at the bcrypt@5.0.0 install script.

    npm ERR! code ELIFECYCLE
    npm ERR! errno 9009
    npm ERR! bcrypt@5.0.0 install: `node-pre-gyp install --fallback-to-build`
    npm ERR! Exit status 9009
    npm ERR!
    npm ERR! Failed at the bcrypt@5.0.0 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    Solution1

    Reason for Error : Node maybe can’t able to find the Python path on your system

    step: 1 Rum command prompt as administrator step 2 Install the package

      npm install --global --production windows-build-tools

    It may take some while, keep patient

    step 3 Now install

    npm install node-gyp

    Last step Now you are ready to Go

    npm install bcrypt

     

    • 安装命令使用下面的命令 XXX换成在里面报错无法正常安装的插件名称
    npm i XXXX --ignore-scripts
    // or
    yarn XXXX --ignore-scripts
    声明 欢迎转载,但请保留文章原始出处:) 博客园:https://www.cnblogs.com/chenxiaomeng/ 如出现转载未声明 将追究法律责任~谢谢合作
  • 相关阅读:
    统计任意字符串中字符出现次数,利用HashMap实现
    常用控件的使用方法
    Opencv读取图片和视频
    复制文件夹(多级递归)
    将指定文件中的数据存入集合中
    将集合中的学生对象输出到指定文件中
    利用缓冲字符输入流读取学生姓名名单实现点名
    字符流中的编码和解码分析
    字节缓冲流和基本字节流读取文件(一个字节读取,一个字节数组读取)
    路径中““、“/“的区别
  • 原文地址:https://www.cnblogs.com/chenxiaomeng/p/15352880.html
Copyright © 2011-2022 走看看