OHIF Viewers 本地运行

版本要求:

复制代码
"node": ">=18",
"npm": ">=6",
"yarn": ">=1.20.0"

Node.js 需要18版本以上,但是我用的是最新版本

具体步骤

第一步:先从github里面下载出源码

第二步: npm install -g yarn 下载yarn

第三步: GitHub - OHIF/Viewers: OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages

复制代码
git clone https://github.com/OHIF/Viewers.git
yarn config set workspaces-experimental true
yarn install
yarn run dev  

报错了

我在下载依赖的时候发生问题,一直报错yarn install 报错了

复制代码
PS C:\Users\licam\Desktop\ohifviewers> yarn install        
yarn install v1.22.22
$ node preinstall.js
系统找不到指定的路径。
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

解决问题:

先把yarn 的镜像换成国内的

我的npm node 都是国内的

使用管理员身份打开cmd命令窗口(打开方法见下方Tips),输入

复制代码
npm config set prefix "你的路径\node_global" (复制刚刚创建的"node_global"文件夹路径)
    npm config set prefix "D:\Study\nodejs\node_global"
npm config set cache "你的路径\node_cache" (复制刚刚创建的"node_cache"文件夹路径)
    npm config set cache "D:\Study\nodejs\node_cache" 
    npm install yarn --location=global    //安装yarn

验证是否安装上yarn

复制代码
win+R打开cmd
输入
yarn -v,查看yarn版本,验证是否安装成功
输入
yarn config list命令可以查看node配置的全局路径、缓存路径、以及淘宝镜像路径,查看是否安装正确

更换yarn镜像

复制代码
yarn config get registry    //yarn的命令
yarn config set registry https://registry.npmmirror.com    //yarn的命令

然后下载的时候 开外网,设置 yarn 的代理

注意: 一定是更换https_proxy 的代理

复制代码
yarn config set https-proxy  http://localhost:自己代理端口



PS C:\Users\licam\Desktop\Viewers-master> yarn config list
yarn config v1.22.22
info yarn config
{
  'version-tag-prefix': 'v',
  'version-git-tag': true,
  'version-commit-hooks': true,
  'version-git-sign': false,
  'version-git-message': 'v%s',
  'init-version': '1.0.0',
  'init-license': 'MIT',
  'save-prefix': '^',
  'bin-links': true,
  'ignore-scripts': false,
  'ignore-optional': false,
  registry: 'https://registry.npmmirror.com/',
  'strict-ssl': true,
  'user-agent': 'yarn/1.22.22 npm/? node/v20.16.0 win32 x64',
  'https-proxy': 'http://localhost:自己代理端口',
  'ignore-engines': true,
  lastUpdateCheck: 1724204727474,
 
  'workspaces-experimental': true
}
info npm config
{
  prefix: 'D:\\APPS\\NVM\\nodejs\\node_global',
  cache: 'D:\\APPS\\NVM\\nodejs\\node_cache',
  registry: 'https://registry.npmmirror.com'
}

输入: ------下载依赖

复制代码
yarn install   
就能下载了,有点慢 ,  现在下载有半个小时了 不动了  下载了有一个小时

启动项目

复制代码
yarn run dev

默认的浏览器 :http://localhost:3000

如果该端口占用, 自己打开服务,停一下

这个是你项目的项目结构

运行起来,页面是这样的

随便点一个

点击基础查看器

就是这个可以查看在医院拍的片子 啦啦啦

相关推荐
程序员的世界你不懂6 分钟前
【Flask】测试平台开发,新增说明书编写和展示功能 第二十三篇
java·前端·数据库
索迪迈科技8 分钟前
网络请求库——Axios库深度解析
前端·网络·vue.js·北京百思可瑞教育·百思可瑞教育
gnip16 分钟前
JavaScript二叉树相关概念
前端
attitude.x1 小时前
PyTorch 动态图的灵活性与实用技巧
前端·人工智能·深度学习
β添砖java1 小时前
CSS3核心技术
前端·css·css3
空山新雨(大队长)1 小时前
HTML第八课:HTML4和HTML5的区别
前端·html·html5
猫头虎-前端技术2 小时前
浏览器兼容性问题全解:CSS 前缀、Grid/Flex 布局兼容方案与跨浏览器调试技巧
前端·css·node.js·bootstrap·ecmascript·css3·媒体
阿珊和她的猫2 小时前
探索 CSS 过渡:打造流畅网页交互体验
前端·css
元亓亓亓2 小时前
JavaWeb--day1--HTML&CSS
前端·css·html