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

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

这个是你项目的项目结构

运行起来,页面是这样的

随便点一个

点击基础查看器

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

相关推荐
崔庆才丨静觅4 小时前
hCaptcha 验证码图像识别 API 对接教程
前端
passerby60614 小时前
完成前端时间处理的另一块版图
前端·github·web components
掘了4 小时前
「2025 年终总结」在所有失去的人中,我最怀念我自己
前端·后端·年终总结
崔庆才丨静觅5 小时前
实用免费的 Short URL 短链接 API 对接说明
前端
崔庆才丨静觅5 小时前
5分钟快速搭建 AI 平台并用它赚钱!
前端
崔庆才丨静觅5 小时前
比官方便宜一半以上!Midjourney API 申请及使用
前端
Moment5 小时前
富文本编辑器在 AI 时代为什么这么受欢迎
前端·javascript·后端
崔庆才丨静觅6 小时前
刷屏全网的“nano-banana”API接入指南!0.1元/张量产高清创意图,开发者必藏
前端
剪刀石头布啊6 小时前
jwt介绍
前端
爱敲代码的小鱼6 小时前
AJAX(异步交互的技术来实现从服务端中获取数据):
前端·javascript·ajax