generator-sails-rest-api
generator-sails-rest-api copied to clipboard
Cannot find module 'passport'
Good morning, I think I have a problem with the dependencies. Indeed, when I run an "npm start"' I get errors like "Local package.json exists, but node_modules missing, did you mean to install?" so I run npm install and once done I still have missing dependencies. "Details:Error: Cannot find module'passport'". Sincerely Pierre Sorry about my English I'm French;) NPM Start : `info: Starting app...
/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/include-all/lib/help-include-all-sync.js:281 throw e; ^
include-all attempted to require(/home/pierre/lab/js/test/newtestsailsyeoman/config/passport.js), but an error occurred::
Details:Error: Cannot find module 'passport'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Object..npm/_logs/2018-03-20T09_16_26_523Z-debug.log0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~start: CWD: /home/pierre/lab/js/test/newtestsailsyeoman
10 silly lifecycle [email protected]~start: Args: [ '-c', 'node app.js' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: node app.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.node app.js
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
`
Same here. Start a new project, run npm install, and get this error.
looks like an issue with missing dependencies list in package.json. Just install all the required packages via npm install
After having the same error as @jamestharpe I added each missing dependency after another. At the end there were like ~15 additional dependencies I had to install, even though I didn't want to use things like Location, but still I had to install these dependencies for that.
After this was done, I'm getting the next error which is:
TypeError: _.get is not a function
Probably it's because I'm using Sails v1.0 - I don't know.