简体   繁体   中英

how to solve the error when install module 'mongoose' on Mac

I met a problem when install module 'mongoose' on Mac, the following is the install info: 在此处输入图片说明

it seems the error info has been written into builderror.log, the content of the builderror.log is: 在此处输入图片说明

when I type 'npm list', you can see mongoose is in the list: 在此处输入图片说明

however, under directory /usr/local/bin, you couldn't see module 'mongoose': 在此处输入图片说明

Now the problem is the system can't find the 'mongoose' module, just like: 在此处输入图片说明

the content of test.js is as following, just test whether can collect to the db: 在此处输入图片说明

This problem only happens when install module 'mongoose'. If install other modules, the system can find the module correctly. Anyone know how to solve this problem?

Did you run mongo in separate tab? Try to run sudo mongod and another tab node test.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM