问题umi推荐使用yarn安装,安装umi后,使用umi提示不是内部或者外部命令。('umi' is not recognized as an internal or external command,operable program or batch file.) Show
解决根源在于yarn的global bin目录不在path环境变量的中,解决办法:
4.0.11 • Public • Published 12 hours ago
See our website umijs for more information. Keywordsnone Installnpm i create-umi RepositoryGitgithub.com/umijs/umi Homepagegithub.com/umijs/umi/tree/master/packages/create-umi#readme DownloadsWeekly Downloads1,953 Version4.0.11 LicenseMIT Unpacked Size394 kB Total Files67 Last publish12 hours ago CollaboratorsTry on RunKit Report malware I want to run a React project in my Windows (as a virtual machine of my Mac). In a Command Prompt, after running yarn to install dependencies. I did yarn start. And it gave me 'HTTPS' is not recognized as an internal or external command error. > yarn start yarn run v1.13.0 $ HTTPS=true CERT=cert/localhost.crt KEY=cert/localhost.key umi dev 'HTTPS' is not recognized as an internal or external command, operable program or batch file. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.Does anyone know how to fix this? Edit 1: I upgraded node to v12.16.1 (yarn to 1.13.0, npm to 6.13.4), and did yarn add https and yarn add https-localhost. However, yarn start still returned 'HTTPS' is not recognized as an internal or external command. umi dev returned 'umi' is not recognized as an internal or external command, operable program or batch file.: >umi dev 'umi' is not recognized as an internal or external command, operable program or batch file.Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Pick a username Email AddressPasswordBy clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails. Already on GitHub? Sign in to your account GeneralCan it be used in a production environment?Umi is the underlying front-end framework of Ant Financial, which has directly or indirectly served 600+ applications, including java, node, H5 wireless, Hybrid applications, pure front-end assets applications, CMS applications, and more. How do I view the version numbers such as react, react-dom, and react-router?How to introduce @babel/polyfill?Install dependencies first, Then create a new src/global.js with the following contents: How to dynamically modify the title?The title can be dynamically modified via react-helmet.
Reporting ErrorObject.values is not a functionE.g. Upgrade the node version and make sure the version is 8.10 or greater. exports is not definedE.g. Check the babel configuration to remove unnecessary presets and plugins. Plugin umi-plugin-react:pwa initialize failedE.g. Make sure you have package.json and have configured the name attribute. E.g. This is a problem with the webpack plugin, which does not affect the normal production of CSS files and can be ignored for now. umi is not an internal or external commandE.g. You need to configure the NODE_PATH environment variable. If you use yarn, you can get the bin path by executing yarn global bin. webpackHow to configure additional loader?For example, I hope .svg not to produce base64, but to generate svg files, which can be configured like this: CSSWhy don't my imported CSS files take effect?umi use css modules by default, please write your css as css modules. Ref:
How to disable CSS modules?Modify .umirc.js: However, it is not recommended to turn off css modules for no particular reason. How to use sass?Install additional dependencies first, Then modify .umirc.js: TestHow to do breakpoint debugging?Make sure node version is above 8.10 and then execute: Then open chrome://inspect/#devices in the browser for inspect and breakpoints. DeploymentAfter the build access route is refreshed 404?Several options are available:
After the build, the picture is lost?It may be that the picture is not correctly quoted. You can refer to the code and import the picture correctly. Use in css, be careful not to use absolute paths
SSRdocument is not defined, navigator is not defined, * is not not definedWhy: umiJS SSR executes code first server-side, then client-side. The document, navigator object is only present client-side. Solution:
UMI UIUmi version is too low, please upgrade to or aboveUmi UI requires or above, and this error will be reported if the version of the local project does not match. The solution is to upgrade to the latest version.
EACCES: permission denied create-umiUmi UI needs to have permission to create projects. The solution is to raise the prompted path permissions and give execute permissions.。 |