本人是個新手,現在想進行前後端的交互,於是我用
npm install -g express-generator
到Visual Studio Code安裝時出現以下問題
PS D:\web\website> npm install -g express-generator
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)D:\Program Files(x86)\nodejs\node_global\express -> D:\Program Files(x86)\nodejs\node_global\node_modules\express-generator\bin\express-cli.js
+ express-generator@4.16.1
updated 1 package in 0.788s
而我使用
npm install mkdirp@1
會出現
npm install mkdirp@1
npm WARN website No description
npm WARN website No repository field.
npm WARN website No license field.
+ mkdirp@1.0.4
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
而我不管他直接用
express website
會出現以下error
express : File D:\Program Files (x86)\Nodejs\node_global\express.ps1 cannot be loaded. The file D:\Program Files (x86)\Nodejs\node_global\express.ps1 is not digitally signed. Y
ou cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.co
m/fwlink/?LinkID=135170.
At line:1 char:1
+ express website
+ ~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
重裝VS,mkdir,nodejs也沒用
請問該如何解決?
你使用的npm install XXX,都有安裝成功,不清楚你是哪邊有問題
真正出問題的在express website
依照官方範例
請用以下指令執行express-generator
express --view=hbs "你想要安裝得路徑" && cd "你想要安裝得路徑"
產生express 專案,並切換到該專案資料夾npm install
安裝所需套件npm start
執行專案詳情請前往express-generator,查看文件