Skip to content

Support npm run build for Wasp Studio on Windows #3043

@nodtem66

Description

@nodtem66

This is an issue for the PR #3020

Describe the bug

Cannot build Wasp studio on Windows due to the Unix commands in package.json

To Reproduce
Steps to reproduce the behavior:

  • Install NodeJS
  • Clone commit bba407d
  • Change directory to ./waspc/packages/studio/
  • Install dependencies
npm ci
  • Run build
npm run build
  • The console will show the error:
> [email protected] build
> npm run build:client && rm -rf dist && tsc && cp -r ./public ./dist/public

> [email protected] build:client
> npm --prefix ./client install && npm --prefix ./client run copy

> [email protected] copy
> npm run build && cp -r ./dist/* ../public

> [email protected] build
> tsc && vite build

vite v4.5.3 building for production...
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
✓ 1057 modules transformed.
dist/index.html                     0.40 kB │ gzip:   0.27 kB
dist/assets/index-17ce6ed4.css    157.34 kB │ gzip:  18.98 kB
dist/assets/index-62a9d21a.js     496.83 kB │ gzip: 162.59 kB
dist/assets/Flow-b5112d3d.js    1,373.26 kB │ gzip: 421.00 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 13.36s

'cp' is not recognized as an internal or external command,
operable program or batch file.

Problem

cp -r and rm -rf are not valid commands on Windows

Environment:

  • OS: Windows 11 (Build 10.0.26100)
  • Node v22.14.0
  • NPM 11.4.2
  • Powershell 5.1.26100.4768
  • CMD Version 10.0.26100.4770

PS. I've already fixed this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwindows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions