box-community / sample-image-skills

🏞 Box Skills samples for processing image files
https://developer.box.com/docs/box-skills
Apache License 2.0
0 stars 0 forks source link

Unable to import module 'index' #14

Closed mngrant-zz closed 5 years ago

mngrant-zz commented 5 years ago

Just running some tests with our first skill and specifically want to test EXIF extraction.

Workflow goes just fine, AWS sets up resources and ServiceEndpoint URL appears to connect, but CloudWatch is reporting:

Unable to import module 'index': Error at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.<anonymous> (/var/task/skills-kit-2.0.js:16:16) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

Followed README.md exactly, no error reported.

mngrant-zz commented 5 years ago

Looks like documentation missed installing the package.json with a npm install Before running deploy. Doing this and re-running serverless deploy fixed this.

eshaverma commented 5 years ago

Thanks @mngrant good to know. I think instead of serverless deploy -v, the documentation was supposed to say npm run deploy. If we look at package.json, the npm command does the install first before deploy in the same command. I have fixed it now.