Friday 16 November 2018

I'm a beginner, and I need some help

Hey guys, I'm a front end developer (html/css/js mainly), and I wanted to dive into node/angular. I started a new project, and wanted to play around with the Destiny 2 API. I found a npm package that is apparently a wrapper for the Destiny 2 API called the-traveler.So in my new project, I went to app.component.ts and pasted in the import/const:import Traveler from 'the-traveler';import { ComponentType } from 'the-traveler/build/enums';const traveler = new Traveler({    apikey: 'pasteYourAPIkey',    userAgent: 'yourUserAgent', //used to identify your request to the API});I do have an API key, but I'm not sure what goes in user agent, so I tried a few things - didn't seem to get any errors caused by that (that I know of).I then served the application and opened it, but I got the error that it failed to compile, along with all of these errors:ERROR in ./node_modules/aws-sign2/index.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\aws-sign2'ERROR in ./node_modules/aws4/aws4.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\aws4'ERROR in ./node_modules/ecc-jsbn/index.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\ecc-jsbn'ERROR in ./node_modules/http-signature/lib/signer.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\http-signature\lib'ERROR in ./node_modules/http-signature/lib/verify.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\http-signature\lib'ERROR in ./node_modules/oauth-sign/index.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\oauth-sign'ERROR in ./node_modules/request/lib/oauth.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\request\lib'ERROR in ./node_modules/request/lib/helpers.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\request\lib'ERROR in ./node_modules/request/lib/hawk.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\request\lib'ERROR in ./node_modules/sshpk/lib/dhe.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/identity.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/certificate.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/private-key.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/key.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/utils.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/fingerprint.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/signature.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/sshpk/lib/formats/pem.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib\formats'ERROR in ./node_modules/sshpk/lib/formats/ssh-private.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib\formats'ERROR in ./node_modules/sshpk/lib/formats/openssh-cert.jsModule not found: Error: Can't resolve 'crypto' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib\formats'ERROR in ./node_modules/node-stream-zip/node_stream_zip.jsModule not found: Error: Can't resolve 'fs' in 'D:\Drift\Code\testiny\node_modules\node-stream-zip'ERROR in ./node_modules/request/lib/har.jsModule not found: Error: Can't resolve 'fs' in 'D:\Drift\Code\testiny\node_modules\request\lib'ERROR in ./node_modules/the-traveler/build/Traveler.jsModule not found: Error: Can't resolve 'fs' in 'D:\Drift\Code\testiny\node_modules\the-traveler\build'ERROR in ./node_modules/forever-agent/index.jsModule not found: Error: Can't resolve 'http' in 'D:\Drift\Code\testiny\node_modules\forever-agent'ERROR in ./node_modules/http-signature/lib/signer.jsModule not found: Error: Can't resolve 'http' in 'D:\Drift\Code\testiny\node_modules\http-signature\lib'ERROR in ./node_modules/request/request.jsModule not found: Error: Can't resolve 'http' in 'D:\Drift\Code\testiny\node_modules\request'ERROR in ./node_modules/tunnel-agent/index.jsModule not found: Error: Can't resolve 'http' in 'D:\Drift\Code\testiny\node_modules\tunnel-agent'ERROR in ./node_modules/forever-agent/index.jsModule not found: Error: Can't resolve 'https' in 'D:\Drift\Code\testiny\node_modules\forever-agent'ERROR in ./node_modules/request/request.jsModule not found: Error: Can't resolve 'https' in 'D:\Drift\Code\testiny\node_modules\request'ERROR in ./node_modules/tunnel-agent/index.jsModule not found: Error: Can't resolve 'https' in 'D:\Drift\Code\testiny\node_modules\tunnel-agent'ERROR in ./node_modules/forever-agent/index.jsModule not found: Error: Can't resolve 'net' in 'D:\Drift\Code\testiny\node_modules\forever-agent'ERROR in ./node_modules/tough-cookie/lib/cookie.jsModule not found: Error: Can't resolve 'net' in 'D:\Drift\Code\testiny\node_modules\tough-cookie\lib'ERROR in ./node_modules/tunnel-agent/index.jsModule not found: Error: Can't resolve 'net' in 'D:\Drift\Code\testiny\node_modules\tunnel-agent'ERROR in ./node_modules/mime-types/index.jsModule not found: Error: Can't resolve 'path' in 'D:\Drift\Code\testiny\node_modules\mime-types'ERROR in ./node_modules/node-stream-zip/node_stream_zip.jsModule not found: Error: Can't resolve 'path' in 'D:\Drift\Code\testiny\node_modules\node-stream-zip'ERROR in ./node_modules/assert-plus/assert.jsModule not found: Error: Can't resolve 'stream' in 'D:\Drift\Code\testiny\node_modules\assert-plus'ERROR in ./node_modules/combined-stream/lib/combined_stream.jsModule not found: Error: Can't resolve 'stream' in 'D:\Drift\Code\testiny\node_modules\combined-stream\lib'ERROR in ./node_modules/delayed-stream/lib/delayed_stream.jsModule not found: Error: Can't resolve 'stream' in 'D:\Drift\Code\testiny\node_modules\delayed-stream\lib'ERROR in ./node_modules/isstream/isstream.jsModule not found: Error: Can't resolve 'stream' in 'D:\Drift\Code\testiny\node_modules\isstream'ERROR in ./node_modules/node-stream-zip/node_stream_zip.jsModule not found: Error: Can't resolve 'stream' in 'D:\Drift\Code\testiny\node_modules\node-stream-zip'ERROR in ./node_modules/request/request.jsModule not found: Error: Can't resolve 'stream' in 'D:\Drift\Code\testiny\node_modules\request'ERROR in ./node_modules/sshpk/lib/ed-compat.jsModule not found: Error: Can't resolve 'stream' in 'D:\Drift\Code\testiny\node_modules\sshpk\lib'ERROR in ./node_modules/forever-agent/index.jsModule not found: Error: Can't resolve 'tls' in 'D:\Drift\Code\testiny\node_modules\forever-agent'ERROR in ./node_modules/tunnel-agent/index.jsModule not found: Error: Can't resolve 'tls' in 'D:\Drift\Code\testiny\node_modules\tunnel-agent'ERROR in ./node_modules/node-stream-zip/node_stream_zip.jsModule not found: Error: Can't resolve 'zlib' in 'D:\Drift\Code\testiny\node_modules\node-stream-zip'ERROR in ./node_modules/request/request.jsModule not found: Error: Can't resolve 'zlib' in 'D:\Drift\Code\testiny\node_modules\request'I've tried a few other destiny api wrappers and they are all giving me the same errors, so I'm just assuming I'm putting the code in the wrong place lol.I'm using the most up to date versions of everything as well fyi. Any help would be greatly appreciated.

Submitted November 16, 2018 at 08:57PM by cozyrobinson

No comments:

Post a Comment