1、ng new xxx 错误
1)Unexpected end of JSON input while parsing near
解决方法:
进入下面这个文件夹清除cache
路径:C:/Users/PC/AppData/Roaming/npm-cache
执行:npm cache clean --force
2)ReactNative问题: warning react-native > create-react-class > fbjs > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2
解决方法:
npm install --save core-js@^3
2、ng build --prod 时报错(C:\Users\scn40020\AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system)
解决方法:
1、搜索powershell,右键以管理员身份运行
2、执行:set-ExecutionPolicy RemoteSigned
3、查看执行策略:get-ExecutionPolicy