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

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

这个是你项目的项目结构

运行起来,页面是这样的

随便点一个

点击基础查看器

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

相关推荐
o***Z4481 小时前
前端性能优化案例
前端
张拭心2 小时前
前端没有实际的必要了?结合今年工作内容,谈谈我的看法
前端·ai编程
姜太小白2 小时前
【前端】CSS媒体查询响应式设计详解:@media (max-width: 600px) {……}
前端·css·媒体
HIT_Weston2 小时前
39、【Ubuntu】【远程开发】拉出内网 Web 服务:构建静态网页(二)
linux·前端·ubuntu
百***06012 小时前
SpringMVC 请求参数接收
前端·javascript·算法
天外天-亮2 小时前
Vue + excel下载 + 水印
前端·vue.js·excel
起个名字逛街玩2 小时前
前端正在走向“工程系统化”:从页面开发到复杂产品架构的深度进化
前端·架构
用户47949283569152 小时前
React 渲染两次:是 Bug 还是 Feature?聊聊严格模式的“良苦用心”
前端·react.js·前端框架
b***74883 小时前
前端GraphQL案例
前端·后端·graphql
云飞云共享云桌面3 小时前
无需配置传统电脑——智能装备工厂10个SolidWorks共享一台工作站
运维·服务器·前端·网络·算法·电脑