Nodejs10 installation tutorial Comments

In the installation nodejs fashion five or six times, the feeling is that want to make the keyboard, writing this blog today want to install nodejs fewer people take some detours, spend their time learning or work.

table of Contents

First, the tutorial environment

Second, download nodejs

Three, nodejs mounting step

Fourth, the installation was encountered pit


First, the tutorial environment

  • System: win10 Home Edition

  • nodejs Version: 10.17.0

 

Second, download nodejs

Download high version: https://nodejs.org/zh-cn/download/

 

Low / historical version Download: https://nodejs.org/zh-cn/download/releases/

 

Three, nodejs mounting step

  • No specific demand has been the point [next] on the line

 

  • Finally, click [finish] to run

  • Test whether the installation is successful

1) using {win + R] Run command

 

2) test nodejs, use the command: node -v

 

3) test npm, use the command: npm -v

 

  • Configuring environment properties that create node_global, node_cache file and configuration path

1) Create a folder

2) configuration path [pit]

Nodejs the global configuration file folder path without quotation marks, the correct order is as follows:

npm config set prefix D:\nodejs\node_global

npm config set cache "D:\NodeJS\node_cache"

 

After two successful command does not display information, an error message is displayed after the failure:

 

  • About Environment Variables

nodejs default installation setting environment variables, and therefore do not have to set up. Some people just because of changed the default settings of the environment variables that led to nodejs not take.

If you can not use after the installation, you need to manually set it.

    

    

    If you do not use, adding an environment variable to point node_global folder NODE_PATH

    

 

Fourth, the installation was encountered pit

Remember to install five or six times, first installed version 12.0, version 11.0 is installed after the last version 10.0 is installed. Because when installed is the latest nodejs, there are locally cached files after installation, installed after lead node can be used, but not with npm, the solution is to delete cache files.

  • 如果用不成npm可以试试删除C:\Users\Admin下的.npmrc或者.node_repl_history,这两个文件有哪一个就删除哪一个。其中第一个为低版本的缓存文件、第二个为新版本的缓存文件。

 

  • 如果还不行,在试试删除C:\Users\Admin\AppData\Roaming的这两个文件夹,然后卸载nodejs,重启电脑在安装一遍nodejs。

    

希望对你有帮助~

发布了83 篇原创文章 · 获赞 136 · 访问量 3万+

Guess you like

Origin blog.csdn.net/weixin_43217942/article/details/103273333