Running into an interesting issue with my Gatsby site which is deploying properly on Netlify at the moment. I installed the CLI because sometimes I can run dev and build locally without issue but when I push my changes to GitHub and Netlify does it’s build – it will fail. I figured the CLI tool can help me mitigate issues before I push code.
Currently if I run netlify dev I get the following:
◈ Netlify Dev ◈
◈ Starting Netlify Dev with gatsby
Waiting for localhost:8000.
> stallone.dev@1.0.1 start [local-user-folder]/stallone.dev/stallone.dev-netlify
> serve public/
module.js:550
    throw err;
    ^
Error: Cannot find module '../package'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> ([local-user-folder]/stallone.dev/stallone.dev-netlify/node_modules/.bin/serve:24:13)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! stallone.dev@1.0.1 start: `serve public/`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the stallone.dev@1.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     [local-user-folder]/.npm/_logs/2019-06-02T13_31_11_106Z-debug.log
Where that debug.log starts going haywire is here:
12 info lifecycle stallone.dev@1.0.1~start: Failed to exec start script
13 verbose stack Error: stallone.dev@1.0.1 start: `serve public/`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> ([local-user-folder].nvm/versions/node/v8.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> ([local-user-folder].nvm/versions/node/v8.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid stallone.dev@1.0.1
15 verbose cwd [local-user-folder]Dropbox/stallone.dev/stallone.dev-netlify
16 verbose Darwin 18.2.0
17 verbose argv "[local-user-folder].nvm/versions/node/v8.15.1/bin/node" "[local-user-folder].nvm/versions/node/v8.15.1/bin/npm" "run" "start"
18 verbose node v8.15.1
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error stallone.dev@1.0.1 start: `serve public/`
22 error Exit status 1
23 error Failed at the stallone.dev@1.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
            