win10安装node后npm 报错

C:UsersAdministrator>npm -v
npm ERR! path C:Program Files
odejs
ode.exe
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn C:Program Files
odejs
ode.exe
npm ERR! enoent spawn C:Program Files
odejs
ode.exe ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Callback called more than once.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersAdministratorAppDataRoaming
pm-cache_logs2018-11-28T08_02_36_124Z-debug.log
6.4.1

输入npm任何命令都会报错
C:Program Files
odejs
ode.exe文件存在
已经重装nodejs过N次!

  

后面尝试过各种办法,安装7.10.1 版本的node确实有效,但是新的属性不能用。

后面总算是找到一个靠谱的:

1、从控制面板删除NodeJs;

2、删除C:UserAdministrator下  “.config”文件夹和  “.node_repl_history” 文件(这里应当是安装好NodeJs后首次使用此产品的用户);

想要看见这个两个文件,需要在查看里面设置查看隐藏文件。

原文地址:https://www.cnblogs.com/muamaker/p/12249914.html