极大可能是引用了node-sass
node-sass内部引用了node-gyp
node-gyp引用了python2.x
解决方案:
1,安装python2.x ,一般是2.7
2,
必须使用管理员身份打开cmd/powershell
否则会报错:
npm ERR! Starting installation...
npm ERR! Please restart this script from an administrative PowerShell!
npm ERR! The build tools cannot be installed without administrative rights.
npm ERR! To fix, right-click on PowerShell and run "as Administrator".
npm --add-python-to-path='true' --debug install --global windows-build-tools
npm install --global node-gyp
第一个命令是安装python的,会等很久。
然后再执行自己的项目,就好了。