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
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值