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

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

这个是你项目的项目结构

运行起来,页面是这样的

随便点一个

点击基础查看器

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

相关推荐
这个昵称也不能用吗?几秒前
react-native搭建开发环境过程记录
前端·react native·cocoapods
hy_花花1 分钟前
Vue3.4之defineModel的用法
前端·vue.js
DataFunTalk15 分钟前
Foundation Agent:深度赋能AI4DATA
前端·后端·算法
hboot17 分钟前
rust 全栈应用框架dioxus
前端·rust·全栈
我是仙女你信不信22 分钟前
生成pdf并下载
前端·javascript·vue.js
少糖研究所22 分钟前
记一次Web Worker的使用
前端·性能优化
乔乔不姓乔呀24 分钟前
pc 和大屏如何适配
前端
speedoooo35 分钟前
新晋前端框架技术:小程序容器与SuperApp构建
前端·小程序·前端框架·web app
傻小胖43 分钟前
Node.js 中文件系统模块(`fs`)的详细总结,包括定义、作用、各种写入方式及使用场景
node.js
vvilkim1 小时前
React 组件类型详解:类组件 vs. 函数组件
前端·javascript·react.js