Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 01 2016 23:48
    @gojko banned @codepreneur
Gojko Adzic
@gojko
@mrjackyliang which version of npm/node are you using?
Jacky Liang
@mrjackyliang
@gojko v12.13.0
Do I need to upgrade node? I think I've only updated the packages so far.
Jacky Liang
@mrjackyliang
I've updated node to v12.16.1 and the same issue happens.
jacky@MacBook-Pro theProject % claudia update --version dev --profile project --use-local-dependencies --npm-options=--force
packaging files npm pack -q /Users/jacky/.code-repository/GitHub/cbnventures/theProject --force
validating package      npm dedupe -q --no-package-lock --force
npm WARN using --force I sure hope you know what you are doing.
npm ERR! code EEXIST
npm ERR! path /private/var/folders/_3/sfzxv2690sn2fmhvq7q06c7h0000gn/T/wERruE/theProject-1.0.0-GJvROC/package/node_modules/claudia/node_modules/.bin/which
npm ERR! Refusing to delete /private/var/folders/_3/sfzxv2690sn2fmhvq7q06c7h0000gn/T/wERruE/theProject-1.0.0-GJvROC/package/node_modules/claudia/node_modules/.bin/which: is outside /private/var/folders/_3/sfzxv2690sn2fmhvq7q06c7h0000gn/T/wERruE/theProject-1.0.0-GJvROC/package/node_modules/claudia/node_modules/which and not a link
npm ERR! File exists: /private/var/folders/_3/sfzxv2690sn2fmhvq7q06c7h0000gn/T/wERruE/theProject-1.0.0-GJvROC/package/node_modules/claudia/node_modules/.bin/which
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jacky/.npm/_logs/2020-03-27T13_44_40_925Z-debug.log
npm dedupe -q --no-package-lock --force failed.
jacky@MacBook-Pro theProject %
Jacky Liang
@mrjackyliang
I also deleted node-modules and package-lock.json to see if the same problem exists, and it still exists.
Jacky Liang
@mrjackyliang
Forgot to mention I was also using npm v6.14.4 while on node v12.13.0 and v12.16.1
Slobodan Stojanović
@stojanovic

This in the npm issue, as you can see in logs, it says:

Refusing to delete /private/.../.bin/which: is outside /private/.../which and not a link
npm ERR! File exists: /private/.../.bin/which
npm ERR! Remove the existing file and try again, or run npm with --force to overwrite files recklessly.

Which is weird, but it can be related to the version of npm you have.
Do you have the same problem when you delete node modules and install them again?

If not, can you try to delete this folder:

/private/var/folders/_3/sfzxv2690sn2fmhvq7q06c7h0000gn/T/wERruE/theProject-1.0.0-GJvROC

And try again?

Jacky Liang
@mrjackyliang
@stojanovic This folder is a temporary folder, each time I run this command, the path between _3 and theProject-1.0.0-xxxxxx are changed.

Do you have the same problem when you delete node modules and install them again?

Yes.

Slobodan Stojanović
@stojanovic
If you use nvm or some similar tool, can you try to change the version of npm?
Jacky Liang
@mrjackyliang
@stojanovic I don't use nvm, or any node version manager. Just upgraded to v12.16.1 using the Node installer.
The error resides inside claudia/node_modules folder. It's probably a caching issue?
Cause the error is node_modules/claudia/node_modules/.bin/which and node_modules/claudia/node_modules/which
I also used claudia pack and the same error happens with --use-local-dependencies
Guy S
@mp3il
Hi,
Whats the correct way to access cookies in claudia js? im using the api builder.
I'm not seeing them in request.normalizedHeaders
Nevermind, i see it now. was looking at old logs.
Jacky Liang
@mrjackyliang
@gojko Did you find a resolution to why this might happen? I can't seem to figure it out still.
Slobodan Stojanović
@stojanovic

The last idea I have:
Try installing Claudia locally (run the npm install claudia -D), and then run the claudia update using your local Claudia. In bash you can use something similar to the following command:

$(npm bin)/claudia update ...

Or you can add the claudia update ... command to your package.json scripts.

Jacky Liang
@mrjackyliang
Are you supposed to install Claudia locally, or globally? Cause I have it installed locally already.
Slobodan Stojanović
@stojanovic
But you are using global version by running claudia update ...
Jacky Liang
@mrjackyliang
I don't have Claudia installed globally
Was that why the error occurred?
Slobodan Stojanović
@stojanovic
Try running the which claudia command
Jacky Liang
@mrjackyliang
jacky@MacBook-Pro theProject % which claudia
/Users/jacky/.code-repository/GitHub/cbnventures/theProject/node_modules/.bin/claudia
Slobodan Stojanović
@stojanovic
Yup, it’s a local version. I am out of ideas. This seems like the NPM issue.
Jacky Liang
@mrjackyliang
Let me install claudia globally, see if that fixes the issue.
Nope, just tried it. Same issue happens.
@stojanovic If I manually pack the zip file, and upload it to Lambda, will that work? I'm still trying to understand AWS
Slobodan Stojanović
@stojanovic
Can you try to install the previous version of npm?
You can deploy the code manually, the easiest way to do that is using the Web Console, if you are not experienced with AWS CLI
Jacky Liang
@mrjackyliang
Downgraded to v6.13.0 and still the same thing

You can deploy the code manually, the easiest way to do that is using the Web Console, if you are not experienced with AWS CLI

@stojanovic Hmm, I can try it out.

Jacky Liang
@mrjackyliang
Happens after I upload and link it to the dev stage.
{
    "errorType": "Runtime.HandlerNotFound",
    "errorMessage": "index.proxyRouter is undefined or not exported",
    "stack": [
        "Runtime.HandlerNotFound: index.proxyRouter is undefined or not exported",
        "    at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)",
        "    at Object.<anonymous> (/var/runtime/index.js:43:30)",
        "    at Module._compile (internal/modules/cjs/loader.js:1158:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)",
        "    at Module.load (internal/modules/cjs/loader.js:1002:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:901:14)",
        "    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)",
        "    at internal/main/run_main_module.js:18:47"
    ]
}
Jacky Liang
@mrjackyliang
So, I am getting this error when unpacking the claudia pack files, modifying the contents, and zipping it with the zip command. Anyone want to tell me what I am missing or doing wrong?
Slobodan Stojanović
@stojanovic
Claudia API Builder is exporting a handler. This error message tells you that you do not have index.js file that exports the proxyRouter function.
Jacky Liang
@mrjackyliang
Oh, I see what I did wrong. I created a zip file including the folder. No wonder.
Jacky Liang
@mrjackyliang
Thank you @stojanovic! Got what I needed
Jacky Liang
@mrjackyliang
I wonder, does the proxyRouter callback function always return a request object? I'm at the ends of writing up the TypeScript documentation.
public proxyRouter(event: RequestAwsProxy, context: LambdaContext, callback?: unknown): Promise<unknown>;
public router(event: RequestAwsProxy, context: LambdaContext, callback?: unknown): Promise<unknown>; // Depreciated.
Slobodan Stojanović
@stojanovic

I am working on a series of 5 minute serverless video tutorials. So far they are not using Claudia, most of the examples are with AWS SAM, but you can apply the same principles with any deployment library.

You can see all of them on the Youtube channel here: https://www.youtube.com/channel/UCgpP4tMRTJz9RY87i6oB2MA

Topics covered so far:

  • Stripe webhook with EventBridge
  • Testing serverles applications with Hexagonal Architecture
  • API Gateway and CORS
Maurício Vielmo Schmaedeck
@schdck
Hey guys! When passing a environment variable using --set-env, what should I do if my environment variable value contains a comma? Is there a way I can scape it? I've tried putting the value between quotes ("), but it didn't work. Thanks :)
Maurício Vielmo Schmaedeck
@schdck
Should I report this as a bug?
Jacky Liang
@mrjackyliang
@schdck Try using \?
Gojko Adzic
@gojko
@schdck I think that won't work directly, but you can try --set-env-from-json and put everything into a JSON file
Florian
@flotob
hi there. does claudia.js also support voice message processing, i.e. exporting received voice messages in a format like .mp3?
Maurício Vielmo Schmaedeck
@schdck
@mrjackyliang I don't think it will work, take a look at the source that is parsing the CSV: https://github.com/claudiajs/claudia/blob/master/src/util/parse-key-value-csv.js
@gojko Yeah, I was trying to automate deploy using GitHub Actions, but the secrets are all environment variables, so it was easier to just pass them through CLI. Ended up creating a middleware that writes this envs to a JSON and passing this JSON to claudia.
Thanks guys.