There is no problem not worth solving, and no technology not worth learning!

ln -sf ../frontend/dist/assets public/assets when building Shopify app template – PHP,lnIs not recognized as an internal or external command, operatorable program or batch file.

在执行:npm run build 时,报错:ln -sf ../frontend/dist/assets public/assets,'ln' is not recognized as an internal or external command,operable program or batch file.

1. When executing: npm run build, an error is reported: ln -sf ../frontend/dist/assets public/assets,lnIs not recognized as an internal or external command, operatorable program or batch file. . as shown in Figure 1

在执行:npm run build 时,报错:ln -sf ../frontend/dist/assets public/assets,'ln' is not recognized as an internal or external command,operable program or batch file.
Figure 1

PS E:\wwwroot\shopify-app\learn-php-app-20230510> npm run build --api-key=a3ca28cb106a5280859a9a52994d3446

> learn-php-app-20230510@1.0.0 build
> shopify app build


 frontend         │
 frontend         │ > build
 frontend         │ > vite build
 frontend         │
 backend          │ > composer build-frontend-links
 frontend         │
 frontend         │ Building the frontend app without an API key. The frontend build will not run without an API key. Set the
                    SHOPIFY_API_KEY environment variable when running the build command.
 frontend         │
 frontend         │ vite v2.9.15 building for production...
 frontend         │ transforming...
 backend          │ > ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html
 backend          │ 'ln' is not recognized as an internal or external command,
 backend          │ operable program or batch file.
 backend          │ Script ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html handling
                    the build-frontend-links event returned with error code 1
 backend          │ Script composer build-frontend-links handling the build event returned with error code 1

── external error ──────────────────────────────────────────────────────────────

Error coming from `composer build`

Command failed with exit code 1: composer build
> composer build-frontend-links
> ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html
'ln' is not recognized as an internal or external command,
operable program or batch file.
Script ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html handling the
 build-frontend-links event returned with error code 1
Script composer build-frontend-links handling the build event returned with error code 1

────────────────────────────────────────────────────────────────────────────────

Error: Failed to kill process 17484: Error: Command failed: taskkill /pid 17484 /T /F
ERROR: The process "17484" not found.

    at file:///E:/wwwroot/shopify-app/learn-php-app-20230510/node_modules/@shopify/cli-kit/dist/public/node/system.js:49:27
    at ChildProcess.exithandler (node:child_process:404:5)
    at ChildProcess.emit (node:events:390:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
PS E:\wwwroot\shopify-app\learn-php-app-20230510>


2. Since the Windows system does not support it, I finally decided to execute this command in the Ubuntu-20.04 system in WSL2. Tip: No such file or directory . as shown in Figure 2

由于 Windows 系统不支持,最终决定在 WSL2 中的 Ubuntu-20.04 系统中执行此命令。提示:No such file or directory
Figure 2

3. You can refer to: Create an application in Ubuntu-20.04 in WSL2: Shopify App template – PHPhttps://www.shuijingwanwq.com/en/2023/07/01/9923/

4. Run the build command again, no more errors.


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$ npm run build --api-key=4611762cfca6d9d949cb806d776c7088

> learn-php-app-ubuntu-2004-0605@1.0.0 build
> shopify app build

 frontend         │
 frontend         │ > shopify-frontend-template-react@1.0.0 build
 frontend         │ > vite build
 frontend         │
 frontend         │
 frontend         │ > shopify-frontend-template-react@1.0.0 build
 frontend         │ > vite build
 frontend         │
 frontend         │
 frontend         │ Building the frontend app without an API key. The frontend build will not run without an API key. Set the
                    SHOPIFY_API_KEY environment variable when running the build command.
 frontend         │
 frontend         │
 frontend         │ Building the frontend app without an API key. The frontend build will not run without an API key. Set the
                    SHOPIFY_API_KEY environment variable when running the build command.
 frontend         │
 frontend         │ vite v4.3.9 building for production...
 frontend         │ vite v4.3.9 building for production...
 frontend         │ transforming...
 frontend         │ transforming...
 backend          │ > composer build-frontend-links
 backend          │ > ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html
 frontend         │ ✓ 1877 modules transformed.
 frontend         │ ✓ 1877 modules transformed.
 frontend         │ rendering chunks...
 frontend         │ rendering chunks...
 frontend         │ computing gzip size...
 frontend         │ computing gzip size...
 frontend         │ dist/assets/empty-state-8039a1e1.svg      0.26 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/empty-state-8039a1e1.svg      0.26 kB │ gzip:   0.20 kB
 frontend         │ dist/index.html                           0.48 kB │ gzip:   0.33 kB
 frontend         │ dist/assets/home-trophy-d70b3542.png     20.65 kB
 frontend         │ dist/assets/index-37530742.css          371.48 kB │ gzip:  45.42 kB
 frontend         │ dist/assets/ja-abb1af27.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/ko-ef9a93f5.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/th-32f01d1c.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/zh-4775ba45.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/vi-72f55a87.js                0.23 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/nb-79727cd5.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/tr-d5c962f0.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/de-5d4a5256.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/fi-e67a7779.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/nl-ed6c02b1.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/da-9b835bb8.js                0.31 kB │ gzip:   0.22 kB
 frontend         │ dist/assets/cs-d855408e.js                0.32 kB │ gzip:   0.23 kB
 frontend         │ dist/assets/sv-8ac62b51.js                0.37 kB │ gzip:   0.25 kB
 frontend         │ dist/assets/en-d265ad8d.js                0.41 kB │ gzip:   0.26 kB
 frontend         │ dist/assets/es-fd2f35f4.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-227fd344.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-PT-a0c51464.js             0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pl-ab15c7ea.js                0.42 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/fr-23e50d95.js                0.43 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/it-08f76780.js                0.45 kB │ gzip:   0.30 kB
 frontend         │ dist/assets/en-df34a502.js                1.53 kB │ gzip:   0.77 kB
 frontend         │ dist/assets/de-2ae5c9fa.js                1.72 kB │ gzip:   0.90 kB
 frontend         │ dist/assets/fr-5253333d.js                1.83 kB │ gzip:   0.94 kB
 frontend         │ dist/assets/polyfill-force-b2df9935.js    5.21 kB │ gzip:   2.02 kB
 frontend         │ dist/assets/zh-CN-cf74d136.js             7.72 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/zh-TW-6a74a185.js             7.86 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/ko-2cf626e6.js                8.18 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/ja-6f78282b.js                8.35 kB │ gzip:   3.58 kB
 frontend         │ dist/assets/en-c240dff3.js                9.95 kB │ gzip:   2.95 kB
 frontend         │ dist/assets/vi-e4ef4fd6.js                9.97 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/th-2a34d5e0.js               10.14 kB │ gzip:   3.77 kB
 frontend         │ dist/assets/sv-a901b08f.js               10.22 kB │ gzip:   3.27 kB
 frontend         │ dist/assets/da-1564850b.js               10.30 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/nb-0a6d8490.js               10.35 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pl-a603e9c2.js               10.39 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/cs-3c753a97.js               10.40 kB │ gzip:   3.50 kB
 frontend         │ dist/assets/fi-c0a9d95f.js               10.63 kB │ gzip:   3.41 kB
 frontend         │ dist/assets/tr-bd45be97.js               10.68 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/it-8bb02787.js               10.72 kB │ gzip:   3.32 kB
 frontend         │ dist/assets/pt-PT-af188c06.js            10.85 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/nl-0772ea77.js               10.89 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pt-BR-8a1d5660.js            10.94 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/es-5e0e20e7.js               10.95 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/de-a04fe3bd.js               11.11 kB │ gzip:   3.35 kB
 frontend         │ dist/assets/fr-1848494a.js               11.31 kB │ gzip:   3.48 kB
 frontend         │ dist/assets/index-92a00347.js            38.36 kB │ gzip:  15.16 kB
 frontend         │ dist/assets/polyfill-6fab3648.js        133.64 kB │ gzip:  40.74 kB
 frontend         │ dist/assets/index-e36d32ea.js           614.98 kB │ gzip: 163.80 kB
 frontend         │ ✓ built in 43.09s
 frontend         │
 frontend         │ (!) Some chunks are larger than 500 kBs after minification. Consider:
 frontend         │ - Using dynamic import() to code-split the application
 frontend         │ - Use build.rollupOptions.output.manualChunks to improve chunking:
                    https://rollupjs.org/configuration-options/#output-manualchunks
 frontend         │ - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
 frontend         │ dist/index.html                           0.48 kB │ gzip:   0.33 kB
 frontend         │ dist/assets/home-trophy-d70b3542.png     20.65 kB
 frontend         │ dist/assets/index-37530742.css          371.48 kB │ gzip:  45.42 kB
 frontend         │ dist/assets/ja-abb1af27.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/ko-ef9a93f5.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/th-32f01d1c.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/zh-4775ba45.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/vi-72f55a87.js                0.23 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/nb-79727cd5.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/tr-d5c962f0.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/nl-ed6c02b1.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/fi-e67a7779.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/de-5d4a5256.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/da-9b835bb8.js                0.31 kB │ gzip:   0.22 kB
 frontend         │ dist/assets/cs-d855408e.js                0.32 kB │ gzip:   0.23 kB
 frontend         │ dist/assets/sv-8ac62b51.js                0.37 kB │ gzip:   0.25 kB
 frontend         │ dist/assets/en-d265ad8d.js                0.41 kB │ gzip:   0.26 kB
 frontend         │ dist/assets/es-fd2f35f4.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-227fd344.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-PT-a0c51464.js             0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pl-ab15c7ea.js                0.42 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/fr-23e50d95.js                0.43 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/it-08f76780.js                0.45 kB │ gzip:   0.30 kB
 frontend         │ dist/assets/en-df34a502.js                1.53 kB │ gzip:   0.77 kB
 frontend         │ dist/assets/de-2ae5c9fa.js                1.72 kB │ gzip:   0.90 kB
 frontend         │ dist/assets/fr-5253333d.js                1.83 kB │ gzip:   0.94 kB
 frontend         │ dist/assets/polyfill-force-b2df9935.js    5.21 kB │ gzip:   2.02 kB
 frontend         │ dist/assets/zh-CN-cf74d136.js             7.72 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/zh-TW-6a74a185.js             7.86 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/ko-2cf626e6.js                8.18 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/ja-6f78282b.js                8.35 kB │ gzip:   3.58 kB
 frontend         │ dist/assets/en-c240dff3.js                9.95 kB │ gzip:   2.95 kB
 frontend         │ dist/assets/vi-e4ef4fd6.js                9.97 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/th-2a34d5e0.js               10.14 kB │ gzip:   3.77 kB
 frontend         │ dist/assets/sv-a901b08f.js               10.22 kB │ gzip:   3.27 kB
 frontend         │ dist/assets/da-1564850b.js               10.30 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/nb-0a6d8490.js               10.35 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pl-a603e9c2.js               10.39 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/cs-3c753a97.js               10.40 kB │ gzip:   3.50 kB
 frontend         │ dist/assets/fi-c0a9d95f.js               10.63 kB │ gzip:   3.41 kB
 frontend         │ dist/assets/tr-bd45be97.js               10.68 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/it-8bb02787.js               10.72 kB │ gzip:   3.32 kB
 frontend         │ dist/assets/pt-PT-af188c06.js            10.85 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/nl-0772ea77.js               10.89 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pt-BR-8a1d5660.js            10.94 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/es-5e0e20e7.js               10.95 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/de-a04fe3bd.js               11.11 kB │ gzip:   3.35 kB
 frontend         │ dist/assets/fr-1848494a.js               11.31 kB │ gzip:   3.48 kB
 frontend         │ dist/assets/index-92a00347.js            38.36 kB │ gzip:  15.16 kB
 frontend         │ dist/assets/polyfill-6fab3648.js        133.64 kB │ gzip:  40.74 kB
 frontend         │ dist/assets/index-e36d32ea.js           614.98 kB │ gzip: 163.80 kB
 frontend         │ ✓ built in 43.05s
 frontend         │
 frontend         │ (!) Some chunks are larger than 500 kBs after minification. Consider:
 frontend         │ - Using dynamic import() to code-split the application
 frontend         │ - Use build.rollupOptions.output.manualChunks to improve chunking:
                    https://rollupjs.org/configuration-options/#output-manualchunks
 frontend         │ - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

╭─ success ────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  learn-php-app-ubuntu-2004-0605 built!                                       │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$


Linux Server Operations, Deployment & Production Troubleshooting

If your website or backend service runs on a Linux server and you are facing unstable access, Nginx configuration issues, MySQL / Redis errors, Docker service failures, full disk usage, or high CPU / memory usage, feel free to contact me for remote troubleshooting.

Ideal For:
✅ Website downtime or unstable access
✅ Nginx / PHP-FPM configuration issues
✅ MySQL / Redis performance or connection problems
✅ Docker service deployment and maintenance
✅ Server migration and environment setup
✅ CPU / memory / disk usage investigation

What I Offer:
✅ Linux environment inspection
✅ Website migration and deployment
✅ Nginx / PHP-FPM / MySQL / Redis troubleshooting
✅ Docker configuration and maintenance
✅ Server performance analysis
✅ Long-term remote operations support

Please contact me and mention: Linux Operations Consultation.

Contact Me:
Telegram: @shuijingwan
WeChat: 13980074657
Email: shuijingwanwq@gmail.com

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.