Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CH10 美食分享範例Code無法順利執行( bcrypt 0.8.7 在win10上的問題 ) #37

Closed
Crygar opened this issue Oct 17, 2016 · 5 comments

Comments

@Crygar
Copy link

Crygar commented Oct 17, 2016

  您好,首先感謝您編輯了這麼一本好書,著實獲益良多。以下是我的問題:

  我在執行ch10美食分享範例時,由於win10環境下執行npm install指令會有其中一項bcrypt 0.8.7無法安裝,即使照著nodejs/node-gyp的操作,依然無法解決問題。

On Windows:
Option 2:
--Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.
  💡 [Windows Vista / 7 only] requires .NET Framework 4.5.1

--Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying the proper Python version and path.)

--Launch cmd, npm config set msvs_version 2015

  由於一直無法解決bcrypt 0.8.7安裝問題索性尋找bcryptjs作為替代方案,在package.json刪除bcrypt 0.8.7並手動npm install bcryptjs後直接npm start,一樣沒解決問題,顯示訊息與bcrypt 0.8.7沒安裝完成時執行npm start的情況一模一樣。
  
  請問我是不是漏了什麼步驟,亦或是我沒有找到對的解決方法,以至於導致範例code無法順利運行的情況呢?

==> �  Listening on port 3000. Open up http://localhost:3000/ in your browser.

C:\Users\user\Documents\ReactJS\react-router-redux-node-isomorphic-open-cook\node_modules\mongodb\lib\server.js:261
        process.nextTick(function() { throw err; })
                                      ^
MongoError: failed to connect to server [localhost:27017] on first connect
    at Pool.<anonymous> (C:\Users\user\Documents\ReactJS\react-router-redux-node-isomorphic-open-cook\node_modules\mongodb-core\lib\topologies\server.js:313:35)
    at emitOne (events.js:96:13)
    at Pool.emit (events.js:188:7)
    at Connection.<anonymous> (C:\Users\user\Documents\ReactJS\react-router-redux-node-isomorphic-open-cook\node_modules\mongodb-core\lib\connection\pool.js:260:12)
    at Connection.g (events.js:291:16)
    at emitTwo (events.js:106:13)
    at Connection.emit (events.js:191:7)
    at Socket.<anonymous> (C:\Users\user\Documents\ReactJS\react-router-redux-node-isomorphic-open-cook\node_modules\mongodb-core\lib\connection\connection.js:162:49)
    at Socket.g (events.js:291:16)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1271:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
[nodemon] app crashed - waiting for file changes before starting...
@Crygar Crygar closed this as completed Oct 17, 2016
@kdchang
Copy link
Owner

kdchang commented Oct 18, 2016

@Crygar 您好,謝謝您的肯定,請問您的問題解決了嗎?

@Crygar
Copy link
Author

Crygar commented Oct 23, 2016

@kdchang 您好,很抱歉這麼晚才回應。

  我後來額外在系統上裝了MongoDB 3.2.10後,cmd -> mongod後可以監聽localhost:3000了,但DB無法連到localhost(shut down後mongod.lock有清空),所以預設的資料跟帳號密碼都沒有寫進去,只看得到view。

P.S bcrypt 0.8.7的問題我改用install bcryptjs解決。

ch10_example_problem3
ch10_example_problem4
ch10_example_problem1
ch10_example_problem2

@chienfuchen32
Copy link

謝謝你的幫助! 我也是使用bcryptjs才跳過windows編譯的錯誤

@Crygar
Copy link
Author

Crygar commented Nov 2, 2016

@chienfuchen32 很高興自己的經驗能對別人有所幫助 :)

@chienfuchen32
Copy link

@Crygar 你好 我目前是使用Mongoose官方範例 於MongoDB建製作者的user collection才看的到完整的網站功能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants