udacity / cloud-developer Goto Github PK
View Code? Open in Web Editor NEWcontent for Udacity's cloud developer nanodegree
content for Udacity's cloud developer nanodegree
"npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: ts-node-dev --respawn --transpileOnly ./src/server.ts
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above."
Has anyone seen this before and what are the common solutions? I was worried it had to do with laptop RAM based on the first line of error code, but there seems to be more. Any help would be greatly appeciated.
there have error message
Represents the completion of an asynchronous operation Represents the completion of an asynchronous operation
A function whose declared type is neither 'void' nor 'any' must return a value.ts(2355)
I don't see in the repository "sequelize-typescript" and it has caused an error message in Visual Studio.
import {Sequelize} from 'sequelize-typescript';
import { config } from './config/config';
If the URL being passed to Jimp doesn't work (like the original URL provided with the started code), then the error described in the title of this issue is displayed. This is because Jimp.read throws an exception which should be rejected within util.filterImageFromURL
Since I have no time for creating a full PR with a fix, I'm posting my solution here:
export async function filterImageFromURL(inputURL: string) {
const photo = await Jimp.read(inputURL);
const outPath = `${__dirname}/tmp/filtered.${Math.floor(
Math.random() * 2000
)}.jpg`;
const processedImage = await photo
.resize(256, 256) // resize
.quality(60) // set JPEG quality
.greyscale() // set greyscale
.writeAsync(outPath);
return outPath;
Postman collection is missing to test the REST API.
It is not the collection for the final project, but the Image sharing project.
It will be great if you can add code for exercises from https://github.com/scheeles/cloud-developer/tree/01-start/course-03/
The filterImageFromURL is only working for certain URLs and failing for some valid ones.The server came up with error of could not MIME type for Buffer which originates from Jimp.read
.Please help to resolve this issue
When I'm writing the command 'npm run dev' ,it is showing error and I'm unable to start the server.
C:\Users\GENIUS>npm run dev
[email protected] dev C:\Users\GENIUS
ts-node-dev --respawn --transpileOnly ./src/server.ts
Using ts-node version 8.10.1, typescript version 3.8.3
(node:11848) UnhandledPromiseRejectionWarning: TypeError: express_1.default is not a function
at C:\Users\GENIUS\src\server.ts:10:22
at step (C:\Users\GENIUS\src\server.ts:33:23)
at Object.next (C:\Users\GENIUS\src\server.ts:14:53)
at C:\Users\GENIUS\src\server.ts:8:71
at new Promise ()
at __awaiter (C:\Users\GENIUS\src\server.ts:4:12)
at C:\Users\GENIUS\src\server.ts:6:2
at Object. (C:\Users\GENIUS\src\server.ts:86:3)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Module._compile (C:\Users\GENIUS\node_modules\source-map-support\source-map-support.js:547:25)
(node:11848) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11848) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
rl.on line
rl.on line
Found that jwt library expects the payload to be a plain object. As seen in the course, we send directly the sequelize model instance, which is not a plain object. To solve it, I used the method short()
inside the generateJWT
method:
function generateJWT(user: User): string {
return jwt.sign(user.short(), config.jwt.secret);
}
Image URL used: https://timedotcom.files.wordpress.com/2019/03/kitten-report.jpg
Maybe then could use another image to validate the course project?
Hi,
it looks like the S3_CORS.xml file is missing in the basic server folder.
thank you!
[email protected] dev C:\udacity........\
ts-node-dev --respawn --transpile-only ./src/server.ts
Using ts-node version 8.3.0, typescript version 3.5.3
I have gotten this in attempting to clone repositories today. I am on the latest version of GitHub Desktop. I have tried launching Desktop from GitHub as well as pasting the URL into Desktop with the same results.
unexpectedly, retry 0, exit code 0xC0000142, errno 11
C:\Users\succe.I7DESKTOP\AppData\Local\GitHubDesktop\app-2.4.3\resources\app\git\mingw64\libexec\git-core\git-submodule: fork: retry: Resource temporarily unavailable
0 [main] sh (22048) C:\Users\succe.I7DESKTOP\AppData\Local\GitHubDesktop\app-2.4.3\resources\app\git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1301408/0x1331408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version should
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
15408498 [main] sh 674 dofork: child -1 - forked process 22048 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
C:\Users\succe.I7DESKTOP\AppData\Local\GitHubDesktop\app-2.4.3\resources\app\git\mingw64\libexec\git-core\git-submodule: fork: Resource temporarily unavailable
npm run build displays The syntax of the command is incorrect when it gets to the line of code.
"clean": "rimraf www/ || true",
"build": "npm run clean && tsc && cp package.json www/package.json && mkdir www/tmp/ && cd www && zip -r Archive.zip . && cd ..",.
This seems to be the culprit "&& mkdir www/tmp/"
zip -r Archive.zip . throws it's error if you remove the above line
Hey, just like a heads up, when going through the Serverless stuff, forking and attempting to install the node modules for course4 exercises gives you an error.
The reason is because its attempting to snag the AWS, axios, and other packages from the nexus solutions url in the package-lock file., which doesn't work. To fix this on my end, I deleted the package-json and then removed the aws-sdk dependency from the package.json file. Then I just ran 'npm i aws-sdk' which installed the 2.11100 version. Then I ran 'npm i' to install the other packages and their dependencies and to have it auto generate a new package-lock.json file and voila, everything works now.
If you just try to edit the package.json file and add the 2.1110 as the aws-sdk version it will still error out because the other packages in package-lock are pointing to the nexus solutions endpoints rather than npm endpoints.
Hi Gabe, ran "npm install" and received "found 1 high severity vulnerability".
"npm audit" gives link "https://www.npmjs.com/advisories/1146" and recommends package.json updated from "sequelize": "^5.10.0" to "sequelize": "^5.15.1".
Re-running "npm install" resolves issue with "found 0 vulnerabilities".
This causes a hidden Lambda-code exception which I found via testing the CreateImage code from the API Gateway console.
This
const urlExpiration = process.env.SIGNED_URL_EXPIRATION
should be updated to this
const urlExpiration = Number(process.env.SIGNED_URL_EXPIRATION)
There are several issues with the tslint config provided in the projects. Atleast for c2 restapi & frontend.
I suggest to use a more relaxed tslint config...
Should be "main": "server.js"
instead of "main": "src/server.js"
. Elastic Beanstalk won't put the instance as healthy without this change.
UnhandledPromiseRejectionWarning: Error: Expected "payload" to be a plain object.
...
02/exercises/udacity-c2-restapi/src/controllers/v0/users/routes/auth.router.ts:31:16)
function generateJWT(user: User): string {
//@TODO Use jwt to create a new JWT Payload containing
return jwt.sign(user.toJSON(), config.jwt.secret); //toJSON is required
}
https://stackoverflow.com/questions/47117709/payload-error-in-jsonwebtoken
This was required after npm audit fix
for the rest backend. I don't know about the original code. Please advise if I can send a PL please, thanks, G.
I had an issue running the udacity-c2-restapi exercise to follow along with the lesson . and I had managed to workaround this and I thought this fix might be helpful for anyone facing the same issue.
Steps :
1- Delete package-lock.json โ
2. Update all the npm dependencies to their latest version : here's how โจ
Upon running the app you'll face this typescript error. ๐
The easiest way to fix would be by applying this change to FeedItem and User models at:
src\controllers\v0\feed\models\FeedItem.ts
src\controllers\v0\users\models\User.ts
- export class User extends Model<User>
+ export class User extends Model
- export class FeedItem extends Model<FeedItem>
+ export class FeedItem extends Model
Hope this helps ๐
utils.filterImageFromURL() is giving below error. How can this be resolved?
Error: Could not find MIME for Buffer
at Jimp.parseBitmap (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\utils\image-bitmap.js:156:15)
at Jimp.call [as parseBitmap] (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\index.js:400:17)
at parseBitmap (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\index.js:344:14)
at cb (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\index.js:73:14)
at cb (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\request.js:47:9)
at IncomingMessage. (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules\phin\lib\phin.compiled.js:1:2038)
at IncomingMessage.emit (node:events:538:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
[ERROR] 16:41:19 Error: Could not find MIME for Buffer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.