As someone new to the world of JavaScript development, I'm encountering an error while working through the backbone_blueprints book. Here's the specific error message I've come across:
> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8cffe5e1fce0e9a1eee0e3ebccbca2bda2bc">[email protected]</a> start /Users/noahc/Projects/backbone_blueprints/blog
> nodemon server.js
module.js:340
throw err;
^
Error: Cannot find module '../lib/cli'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/noahc/Projects/backbone_blueprints/blog/node_modules/.bin/nodemon:3:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.10.33
npm ERR! npm v2.1.11
npm ERR! code ELIFECYCLE
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cbb8a2a6bba7aee6a9a7a4ac8bfbe5fae5fb">[email protected]</a> start: `nodemon server.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2b1abafb2aea7efa0aeada582f2ecf3ecf2">[email protected]</a> start script 'nodemon server.js'.
npm ERR! This is most likely a problem with the simple-blog package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nodemon server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls simple-blog
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/noahc/Projects/backbone_blueprints/blog/npm-debug.log
☹ ~/Projects/backbone_blueprints/blog npm install ruby-2.1.3
npm WARN package.json <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8bf8e2e6fbe7eea6e9e7e4eccbbba5baa5bb">[email protected]</a> No repository field.
npm WARN package.json <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2c1dbdfc2ded79fd0deddd5f2829c839c82">[email protected]</a> No README data
A debug log is also available:
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="503e203d10627e617e6161">[email protected]</a>
3 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6e00010a0b2e185e405f5e405d5d">[email protected]</a>
4 verbose node symlink /usr/local/bin/node
5 error install Couldn't read dependencies
6 verbose stack Error: ENOENT, open '/Users/noahc/Projects/backbone_blueprints/package.json'
7 verbose cwd /Users/noahc/Projects/backbone_blueprints
8 error Darwin 14.1.0
9 error argv "node" "/usr/local/bin/npm" "install"
10 error node v0.10.33
11 error npm v2.1.11
12 error path /Users/noahc/Projects/backbone_blueprints/package.json
13 error code ENOPACKAGEJSON
14 error errno 34
15 error package.json ENOENT, open '/Users/noahc/Projects/backbone_blueprints/package.json'
15 error package.json This is most likely not a problem with npm itself.
15 error package.json npm can't find a package.json file in your current directory.
16 verbose exit [ 34, true ]
In addition, when checking for node and npm paths, I found the following:
☹ ~/Projects/backbone_blueprints/blog which node ruby-2.1.3
/usr/local/bin/node
☺ ~/Projects/backbone_blueprints/blog which npm ruby-2.1.3
/usr/local/bin/npm
I speculated that the issue could be related to a path problem. As a result, I tried adding
export NODE_PATH=/opt/lib/node_modules
to my .zshrc file and sourced it, but saw no change in the outcome.
If you have any insights on how I can troubleshoot this issue or gain a better understanding of what's happening, I would greatly appreciate it.