generator-sails-rest-api icon indicating copy to clipboard operation
generator-sails-rest-api copied to clipboard

Cannot find module 'passport'

Open strobelpierre opened this issue 7 years ago • 3 comments
trafficstars

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. (/home/pierre/lab/js/test/newtestsailsyeoman/config/passport.js:9:18) at Module._compile (module.js:649:30) at Object.Module._extensions..js (module.js:660:10) at Module.load (module.js:561:32) at tryModuleLoad (module.js:501:12) at Function.Module._load (module.js:493:3) at Module.require (module.js:593:17) at require (internal/module.js:11:18) at /home/pierre/lab/js/test/newtestsailsyeoman/node_modules/include-all/lib/help-include-all-sync.js:271:33 at Array.forEach () at _recursivelyIncludeAll (/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/include-all/lib/help-include-all-sync.js:174:11) at includeAll (/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/include-all/lib/help-include-all-sync.js:292:5) at helpBuildDictionary (/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/include-all/lib/help-build-dictionary.js:43:15) at Function.module.exports.aggregate (/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/include-all/index.js:101:10) at Array.loadOtherConfigFiles (/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/sails/lib/hooks/moduleloader/index.js:247:22) at /home/pierre/lab/js/test/newtestsailsyeoman/node_modules/async/lib/async.js:591:38 at _arrayEach (/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/async/lib/async.js:85:13) at Object.async.auto (/home/pierre/lab/js/test/newtestsailsyeoman/node_modules/async/lib/async.js:552:9) .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. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) 13 verbose stack at EventEmitter.emit (events.js:180:13) 13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:180:13) 13 verbose stack at maybeClose (internal/child_process.js:936:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 14 verbose pkgid [email protected] 15 verbose cwd /home/pierre/lab/js/test/newtestsailsyeoman 16 verbose Linux 4.13.0-37-generic 17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 18 verbose node v9.8.0 19 verbose npm v5.7.1 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] start: 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 ] `

strobelpierre avatar Mar 20 '18 09:03 strobelpierre

Same here. Start a new project, run npm install, and get this error.

jamestharpe avatar May 05 '18 12:05 jamestharpe

looks like an issue with missing dependencies list in package.json. Just install all the required packages via npm install

ghaiklor avatar May 07 '18 10:05 ghaiklor

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.

ChrizzDF avatar Jul 10 '18 12:07 ChrizzDF