2016-01-19 81 views
0

我是新來的NodeJS,我試圖安裝快遞作爲一個依賴,但如下使我的錯誤::Express安裝問題

C:\wamp\www\ExpressJS\node>npm install express --save 
npm ERR! Windows_NT 10.0.10240 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ 
node_modules\\npm\\bin\\npm-cli.js" "install" "express" "--save" 
npm ERR! node v5.3.0 
npm ERR! npm v3.3.12 
npm ERR! code ENOSELF 

npm ERR! Refusing to install express as a dependency of itself 
npm ERR! 
npm ERR! If you need help, you may report this error at: 
npm ERR!  <https://github.com/npm/npm/issues> 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\wamp\www\ExpressJS\node\npm-debug.log 

**any help would be much appericiated, This is my npm-debug file** 

回答

0

您正在運行npm i express --save位於ExpressJS文件夾內。請出去並在那裏安裝express

0

啓動節點項目時,需要在目標文件夾中使用命令npm init。然後安裝express模塊​​。

0

謝謝,但我解決了這個問題....我運行相同的命令,它安裝。但在我看來,表達式發生器安裝在表達式中......並且它跟你站在哪個文件夾無關... ExpressJs是我的父文件夾。

0

好,我知道了什麼是你確切的問題,那就是,同時通過

NPM初始化

你給的名字作爲依賴名稱創建項目。

因此,通過進入package.json來更改項目名稱,並給出不同的名稱。 然後再通過同樣的命令 像

NPM英索爾--save

安裝,我可以預言,你可能不會再得到同樣的錯誤