window 安裝node 運行報錯C:\Windows\system32\cmd.exe;C:\Windows\system32;

wanyi@DESKTOP-QG5SLAM MINGW64 /d/sourceCode/vue-paas-master/vue-pass (master)
$ npm run build

> [email protected] build D:\sourceCode\vue-paas-master\vue-pass
> node build/build.js

npm ERR! file C:\Windows\system32\cmd.exe;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\SysWOW64
npm ERR! path C:\Windows\system32\cmd.exe;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\SysWOW64
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\SysWOW64
npm ERR! [email protected] build: `node build/build.js`
npm ERR! spawn C:\Windows\system32\cmd.exe;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\SysWOW64 ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\wanyi\AppData\Roaming\npm-cache\_logs\2019-04-18T11_34_30_486Z-debug.log

將系統環境變量ComSpec 去掉,這個環境變量是關於window相關的cmd 指令執行器路徑相關的

win10  ComSpec  = %SystemRoot%\system32\cmd.exe; C:\Windows\SysWOW64; %SystemRoot%\System32\Wbem;
%SystemRoot%;%SystemRoot%\system32

刪除工程中package-lock.json 和node_modules 重新install 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章