zoukankan      html  css  js  c++  java
  • dockercompose up build fail (node no such file or directory packages.json )

    docker构建项目遇到如下问题:


    npm ERR! Darwin 15.0.0 npm ERR! argv "/usr/local/lib/node_modules/iojs-bin/node_modules/iojs-darwin-x64/iojs-v3.3.0-darwin-x64/bin/iojs" "/usr/local/bin/npm" "i" npm ERR! node v3.3.0 npm ERR! npm v3.3.3 npm ERR! path /Users/aredridel/Projects/npm/newww/node_modules/hapi/node_modules/inert/node_modules/lru-cache npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall rename npm ERR! enoent ENOENT:
    npm ERR! Darwin 15.0.0
    npm ERR! argv "/usr/local/lib/node_modules/iojs-bin/node_modules/iojs-darwin-x64/iojs-v3.3.0-darwin-x64/bin/iojs" "/usr/local/bin/npm" "i"
    npm ERR! node v3.3.0
    npm ERR! npm  v3.3.3
    npm ERR! path /Users/aredridel/Projects/npm/newww/node_modules/hapi/node_modules/inert/node_modules/lru-cache
    npm ERR! code ENOENT
    npm ERR! errno -2
    npm ERR! syscall rename
    
    npm ERR! enoent ENOENT: no such file or directory, rename '/Users/aredridel/Projects/npm/newww/node_modules/hapi/node_modules/inert/node_modules/lru-cache' -> '/Users/aredridel/Projects/npm/newww/node_modules/inert/node_modules/lru-cache'
    npm ERR! enoent This is most likely not a problem with npm itself
    npm ERR! enoent and is related to npm not being able to find a file.
    npm ERR! enoent
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     /Users/aredridel/Projects/npm/newww/npm-debug.log
    , rename '/Users/aredridel/Projects/npm/newww/node_modules/hapi/node_modules/inert/node_modules/lru-cache' -> '/Users/aredridel/Projects/npm/newww/node_modules/inert/node_modules/lru-cache' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! /Users/aredridel/Projects/npm/newww/npm-debug.log


    solve method: the path fo source not mount volumes correctly . use kitematice and select the right path
    这里的找不到packages.json 和找不到代码路径有关,主要问题在于kitematic 的版本可能无法识别 docker的compose 文件中mount路径,需要手动挂载项目路径到 volumns 下

    挂载到目录后遇到 找不到express 的错误,
     

    此时,kitematic 管理器中可以使用exec 控制台,进入路径后执行 npm install  --save 

    other question: windows  上docker 默认 default ip 192.168.99.100,如何修改ip:

     a current workaround, assuming you've got the Toolbox installed:

    Close Kitematic
    Delete the current default VM: docker-machine rm -f default
    Create a new default machine docker-machine create -d virtualbox --virtualbox-hostonly-cidr "192.168.99.1/24"
    Open Kitematic and it should be using this VM.

     
    这个方案是先停掉kitematic,然后用docker-machine删除默认的vm实例,重新创建一个vm,指定ip,然后启动kitematic,刚创建的就可以自动识别了 



  • 相关阅读:
    Clipboard.GetImage() Clipboard获取粘贴板内容为null的解决办法
    vs开发 winform 设置winform 获取管理员权限启动
    sql server分配某个用户只对某一个数据库有权限 转载 http://blog.sina.com.cn/s/blog_13554ebc70102wi3h.html
    第一个 谷歌浏览器扩展插件 操作网页
    printDocument设置适应边框打印 特重要 找了半天 设置一个属性即可
    手机网络抓包 转载记录http://blog.csdn.net/skylin19840101/article/details/43485911
    C#合并文件夹图片列表 自定义排版顺序
    ROS nodelet 理解记录
    多线程操作控件属性
    Djianggo 在windows中安装出现报错的解决方案
  • 原文地址:https://www.cnblogs.com/lavin/p/6852230.html
Copyright © 2011-2022 走看看