運(yùn)行npm命令比如think-cli時(shí),報(bào)錯(cuò) 無法加載文件 D:\nodejs\node_global\webpack.ps1,因?yàn)樵诖讼到y(tǒng)上禁止運(yùn)行腳本。
解決方案:
以管理員身份運(yùn)行 PowerShell
執(zhí)行:get-ExecutionPolicy,顯示Restricted,表示狀態(tài)是禁止的
執(zhí)行:set-ExecutionPolicy RemoteSigned
這時(shí)再執(zhí)行g(shù)et-ExecutionPolicy,就顯示RemoteSigned
此時(shí)發(fā)現(xiàn)再進(jìn)行打包就沒有問題了

SharedScreenshot.jpg