VUE installation details and some errors

Foreword
Hello everyone! I am oy, and today I will bring you the implementation and introduction of Android studio login and registration. This is the first time I write a blog, please forgive me.

step

1. Install node.js at https://nodejs.org/en/

The installation path D:\Program Files\nodejsis the same as mine, and the other steps are always next; after the installation is complete, check the version number to judge whether it is successful.

2. Configure the path of npm when installing the global module and the path of the cache cache.

So configure a custom global module installation directory here, and create two folders node_global and node_cache under the node.js installation directory, as shown in the figure:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-BHoYMXhn-1646741938200)(https://secure2.wostatic.cn/static/wFnzWrfnTmFaa5cB2p7xfc/image.png)]

(Because when executing commands such as npm install webpack -g to install globally, the module will be installed in npm and npm_cache under the C:\Users\username\AppData\Roaming path by default, which is inconvenient to manage and takes up space on the C drive )

3. Then in the administrator cmd mode, execute the following two commands:

npm config set prefix “D:\Program Files\nodejs\node_global”

npm config set cache “D:\Program Files\nodejs\node_cache”

4. After execution, configure the environment variables ("This Computer" right click "Properties", "Advanced System Settings" on the right, "Environment Variables")

4-1: "Environment Variables" -> "System Variables": create a new variable named "NODE_PATH", the value is "D:\Program Files\nodejs\node_global\node_modules" 4-2: "Environment Variables" ->
" User variables": Edit the Path in the user variables, and change "C:\Users\admin\AppData\Roaming\npm" to

“D:\Program Files\nodejs\node_global”

5. Switch Taobao image (error 2 may occur) PS: also install cnpm;

npm install -g cnpm --registry=https://registry.npm.taobao.org

6. Install global vue, execute the command: npm install -g vue (error 1 may occur)

7. Install vue scaffolding, cnpm install @vue/cli -g (error 1 may occur)

possible errors

1. If the 4058 error occurs, you need to run cmd in administrator mode.

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-CUaVoPDy-1646741938201)(https://secure2.wostatic.cn/static/furzEgXmnjTTnrnkjdGGgX/image.png)]

Admin mode is on:

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-OchCeR7T-1646741938202)(https://secure2.wostatic.cn/static/29VCjyDKQA8CWHE9cZNRaP/image.png)]

2...if such an error occurs in the administrator:

cnpm : 无法加载文件 D:\nodejs\node_global\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,
请参阅 https:/go.microsoft.com /fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ cnpm install --save-dev electron
+ CategoryInfo          : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

Execution: set-ExecutionPolicy RemoteSigned

Then: Y

as follows

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-MCHlUq4S-1646741938202)(https://secure2.wostatic.cn/static/qw5NRmbCy2orKFy8T6NU5j/image.png)]

You can continue to start the node js command.

Guess you like

Origin blog.csdn.net/m0_49534667/article/details/123361951
Recommended