This is the guideline for nodejs + npm installation on Windows (including windows 7)
npm and Node.js are quite common to the developers but they are unfriendly to Windows.
If you use .msi installation, it usually fails. (see https://github.com/npm/npmlog/issues/48)
Here is to introduce a proper method for its installation.
| Item | Version | Release Date | Download |
| ———————- | ————– | ————- | ——————————————————————– |
| Node.js (Windows 7) | v12.22.6 (LTS) | 31-Aug-2021 | https://nodejs.org/download/release/v12.22.6/win-x64/node.exe
2E820E1C7688484024BFAF13E8F9E11F - 28.8 MB |
| Node.js (Windows 8.1+) | v14.17.6 (LTS) | 31-Aug-2021 | https://nodejs.org/download/release/v14.17.6/win-x64/node.exe
|
| npm (Windows 7+) | 1.4.9 (zip) | 01-May-2014 | https://nodejs.org/dist/npm/npm-1.4.9.zip
7CD8BA6F4582C81709B6705978B4B9ED - 2.19MB |
npm.cmd
and old node_modules
)see https://github.com/cyfung1031/npm-on-windows/blob/main/README_backup_20211013.md
The following installations is to Node.js v14.17.6 and npm v6.14.15.
(For your own installation, you shall refer the corresponding npm version in https://nodejs.org/en/download/releases/ )
node.exe
, npm.cmd
, and node_modules
into C:\nodejs
NODE_SKIP_PLATFORM_CHECK
= 1
Go to control panel -> System -> Advanced System Settings then environment variables.
under system variables i created a new one with NODE_SKIP_PLATFORM_CHECK
and set its value to 1
.
C:
cd nodejs
node -v //display "v14.17.6"
npm -v //display "v6.14.15"
Create Empty Directories C:\nodejs\node_global
and C:\nodejs\node_cache
add PATH C:\nodejs\\;C:\nodejs\node_global\\;
C:\nodejs\node_global\node_modules
npm config set prefix "C:\nodejs\node_global"
npm config set cache "C:\nodejs\node_cache"
- Note 1: As you have added the path
C:\nodejs\
to your system environment,C: cd nodejs
is no longer required.- Note 2: You can edit the text file
%HOMEPATH%\.npmrc
for the same effect.
C:\nodejs\node_global
npm install -g npm@6.14.15
- Note: You can find
npm.cmd
andnpx.cmd
inC:\nodejs\node_global
after installation
cd nodejs
node -v //display "v14.17.6"
npm -v //display "v6.14.15"
npm install --global yarn
npm install --global @vue/cli
vue create XXXXX --packageManager npm
instead of yarn%HOMEPATH%\.vuerc
npm install xxxx
npx xxxx .....
cd xxxxx
code .