zoukankan      html  css  js  c++  java
  • 安装Yapi时,出现json-schema-faker模块找不到问题

    今天换了一台机器按以前的方式安装Yapi工具时,竟然出现了错误。

    一 安装yapi时,出现了下面的报错,一开始以为没安装json-schema-faker模块。后面通过找资料,发现是权限问题,
    使用chown更改下权限

    yapi-vendor@1.5.14 install-server /data/vhosts/vhosts.website/yapi/vendors
    >  node server/install.js
    
    Error:  internal/modules/cjs/loader.js:582
        throw err;
        ^
    
    Error: Cannot find module 'json-schema-faker'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
        at Function.Module._load (internal/modules/cjs/loader.js:506:25)
        at Module.require (internal/modules/cjs/loader.js:636:17)
        at require (internal/modules/cjs/helpers.js:20:18)
        at Object.<anonymous> (/data/vhosts/vhosts.website/yapi/vendors/server/utils/commons.js:21:13)
        at Module._compile (internal/modules/cjs/loader.js:688:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
        at Module.load (internal/modules/cjs/loader.js:598:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
        at Function.Module._load (internal/modules/cjs/loader.js:529:3)
        at Module.require (internal/modules/cjs/loader.js:636:17)
        at require (internal/modules/cjs/helpers.js:20:18)
        at Object.<anonymous> (/data/vhosts/vhosts.website/yapi/vendors/server/install.js:3:17)
        at Module._compile (internal/modules/cjs/loader.js:688:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
        at Module.load (internal/modules/cjs/loader.js:598:32)
    

    二 更改安装目录权限(环境变量配置的目录),不是yapi的目录,是nodejs的目录

    chown -R root:root /nodejs安装目录
    

    三 然后再安装,就不会有问题了。

  • 相关阅读:
    使用Fiddler模拟客户端http响应
    Vim显示行号
    Convert int to byte array
    bare linefeeds received in ASCII mode
    Memory Analyse Tool
    what is the difference between static and normal variables in c++
    Looper Could not create wake pip
    Convert Java Doc to CHM using jd2chm
    ARM(RISC)和x86(CISC)的技术差异
    处理器架构——从RISC与CISC到x86、ARM、MIPS
  • 原文地址:https://www.cnblogs.com/smartrui/p/10767727.html
Copyright © 2011-2022 走看看