- How to make mobile support access to local VUE projects
- Step 1. Change the host value in index.js to ‘0.0.0.0’
- Step 2. Modify the dev value of script in package.json by adding –host 0.0.0.0
- Step 3. Turn off the firewall (# Control Panel –> System and Security –> Windows Firewall –>)
- Description Node-sass initialization failed
- Solutions:
- Save and delete the packages that failed to be installed (skip this step for the first installation)
- npm uninstall node-sass
- reinstall
- npm install node-sass
- Add parameters (–unsafe-perm)
- (–unsafe-perm defaults to false for root and true for others)
- (Set to true, the run Package script will be switched when the UID/GID is explicitly set to false, installation will fail for non-root users)
- npm install –unsafe-perm node-sass
- Add parameter (–user=root)
- npm install –user=root node-sass
- Solutions:
- Prevents the NPM install command from automatically making additional updates to package-lock.json files
- npm install –no-save
- NPM switching source
- Clear the NPM cache
- npm cache clean -f
- Switch the mirror
- To view the mirror address: NPM get Registry
- Set the image of Taobao: NPM config set Registry registry.npm.taobao.org/
- Switch to NPM config set registry registry.npm.taobao.org/
- If you do not use CNPM and want to speed up the download, you can use image, for example:
- npm –registry=registry.npm.taobao.org i
- npm install –registry=registry.npm.taobao.org
- Clear the NPM cache
- Window Common problems when creating folders
- Why can’t folders be named “AUX”?
- Indows cannot name files/folders with the following characters: Du “zhiaux” “COM1” “COM2” “PRN” “con” and “nul”, because these names belong to the device name, equivalent to a DOS device, if we name the file with these names, Windows will mistakenly think that the same name occurred, so it will prompt “can not create the same file” and so on.
- Of course, there are special ways to create folders named after these devices. For example, we created a folder named AUX on drive C by executing “MD C: aux\” at the command prompt. This folder, while accessible and subfolders can be created, cannot be deleted because Windows does not allow devices to be deleted in this way. From the system’s point of view, the AUX folder is the device.
- So, how do you delete such files/folders? As long as we follow the complete UNC path format, that is, the path format of the neighbor on the Internet, the correct input file path and file name can be. For example, to delete the AUX folder in drive C, run rd /s \.\C:\aux at the command prompt. Rd is the command to delete the folder at the command prompt.
- PowerShell creating a vue project prompts that the file vue. PSL cannot be loaded
- Run PowerShell as an administrator
- Get -ExecutionPolicy. If Restricted is displayed, the state is forbidden
- Execute the set-executionPolicy remotesunet
- Select Y
- NPM install failure
- Description Vue -typescript-admin-template-master initialization failed
- Upgrade to the latest stable version of Node first and build again. If this fails again, try solution 1. $NPM install --global --production Windows-build-tools-solution 2, install PYTHon2.7 -- Solution 3, Disable HTTPS for NPM (disable HTTPS authentication for NPM) NPM config set strict-ssl falseCopy the code
2. The following error NPM ERR! code ERR_TLS_CERT_ALTNAME_INVALID ``` npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID npm ERR! request to https://registry.cnpmjs.org/npm failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Admin\AppData\Roaming\ NPM -cache\_logs\ 2021-02-24t02_42_03_866z -debug. Log Disable HTTPS for NPM (disable HTTPS authentication for NPM) NPM config set strict-ssl false NPM install -g supervisorCopy the code
8. Switch administrator rights for PowerShell
Start-Process powershell -Verb runAs
Copy the code
9. Node version manager
You can use GNVM // node to change the GNVM ls GNVM install version number GNVM use version number // NPM to change NPM -g install [email protected]Copy the code