恢复 npmjs 源 npm config set registry https://registry.npmjs.org
检查是否恢复成功 npm config get registry
创建 reactjs 项目
1
npx create-react-app hello-tauri
按照 开发依赖包 @tauri-apps/cli
1 2 3
yarn add -D @tauri-apps/cli cross-env # or npm i -D @tauri-apps/cli cross-env
测试应用是否运行正常
1
npm start
按照依赖 @tauri-apps/api
1 2 3
yarn add @tauri-apps/api # or npm i @tauri-apps/api
初始化 tauri 项目
1 2 3
yarn tauri init # or npm run tauri init
What is your app name? · hello-tauri ✔ What should the window title be? · hello-tauri ? Where are your web assets (HTML/CSS/JS) located, relative to the “/src-tauri/tauri.conf.json” file that will be created? (../build) ✔ Where are your web assets (HTML/CSS/JS) located, relative to the “/src-tauri/tauri.conf.json” file that will be created? · ../build ✔ What is the url of your dev server? · http://localhost:3000