Today found a problem in using the Win10 subsystem process: if the master / sub-system and set the environment variable, then the subsystem will give priority to the host system environment variables ! Figuratively, my lord Node.js already in the system environment variables, then I set the environment subsystem is invalid, run npm will be reported the following error
figure 1
Obviously, the system is running node under the windows, we executed
echo $PATH
figure 2
As can be seen in connection with Figure 1 in the environment variables subsystem comprises a host system environment variable, which is the cause of the error results in FIG. 1 ( Linux windows program execution, error is inevitable ). FIG directly to the environment variable row 2 is also deleted. . But I do not know will not affect the main system, too lazy to toss, so I thought of using the alias command, execute the following command
vim ~/.bashrc
Then in the content append Figure 3 bashrc file (note that "=" followed the path of your node installation path), so as to avoid errors caused by the same name
image 3
Now we perform
cnpm -v
Figure 4
This is no problem friends