How to accept Payments with Stripe - stripe-payments

So this is my first time using Stripe to integrate payments for a website. What I am trying to do is add Stripe to my terminal for it to work correctly but I am getting an error. I have created a "Server" folder along with a "Server.js" file and when I try to initialize a new project it throws me an error.
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Royces-MacBook-Air:Kingdom Website roycewilliams$ $ cd server/
bash: $: command not found
Royces-MacBook-Air:Kingdom Website roycewilliams$ cd server/
Royces-MacBook-Air:server roycewilliams$ npm init -y
node:internal/modules/cjs/loader:926
throw err;
^
Error: Cannot find module './lib/_stream_readable.js'
Require stack:
- /usr/local/lib/node_modules/npm/node_modules/readable-stream/readable.js
- /usr/local/lib/node_modules/npm/node_modules/are-we-there-yet/tracker-stream.js
- /usr/local/lib/node_modules/npm/node_modules/are-we-there-yet/tracker-group.js
- /usr/local/lib/node_modules/npm/node_modules/are-we-there-yet/index.js
- /usr/local/lib/node_modules/npm/node_modules/npmlog/log.js
- /usr/local/lib/node_modules/npm/lib/cli.js
- /usr/local/lib/node_modules/npm/bin/npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:923:15)
at Function.Module._load (node:internal/modules/cjs/loader:768:27)
at Module.require (node:internal/modules/cjs/loader:995:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/readable-stream/readable.js:12:30)
at Module._compile (node:internal/modules/cjs/loader:1091:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1120:10)
at Module.load (node:internal/modules/cjs/loader:971:32)
at Function.Module._load (node:internal/modules/cjs/loader:812:14)
at Module.require (node:internal/modules/cjs/loader:995:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/local/lib/node_modules/npm/node_modules/readable-stream/readable.js',
'/usr/local/lib/node_modules/npm/node_modules/are-we-there-yet/tracker-stream.js',
'/usr/local/lib/node_modules/npm/node_modules/are-we-there-yet/tracker-group.js',
'/usr/local/lib/node_modules/npm/node_modules/are-we-there-yet/index.js',
'/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js',
'/usr/local/lib/node_modules/npm/lib/cli.js',
'/usr/local/lib/node_modules/npm/bin/npm-cli.js'
]
}
Royces-MacBook-Air:server royce
williams$

You probably just need to get the dependencies from npm. Type npm i in the same directory of the project to get the dependencies. If you don’t have npm installed you need to install it first.

Did you create this folder by yourself or did you clone/download it from one of Stripe's examples/repos?
If you downloaded it from somewhere, can you share the link?
Edit: The quickstart guide also has steps that you can follow to setup your integration

Related

How can I run and make changes to a cloned app on my local machine?

I am relatively new to development and currently need to run a client's app on my local machine in order to make and test the changes. I cloned the app from the github repo, but have been unable to run the app on my local machine.
I have used the npm install, then the npm start command, but it gives me this error
`"> node dist/server.js
node:internal/modules/cjs/loader:998
throw err;
^`
Error: Cannot find module '********\dist\server.js' at Module._resolveFilename (node:internal/modules/cjs/loader:995:15) at Module._load (node:internal/modules/cjs/loader:841:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: []
}
Node.js v19.0.1"
I don't know how to proceed with this. Please help
Maybe You Are Missing environment variables. Get Them From The Client.

Playwright won't execute

I'm new to coding and automation tools. I have followed several install guides for playwright but to no avail (most recent one I have tried is the one on Carl Rippon dot com). I've been able to create scripts using the npx playwright codegen www.x.com . However trying to execute these as either a .js or a .ts doesn't seem to do anything at all. I get errors that look like this:
PS C:\Users\SamDavies\Desktop\playwright> node hello-world.js
internal/modules/cjs/loader.js:888
throw err;
^
Error: Cannot find module 'C:\Users\SamDavies\Desktop\playwright\hello-world.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
at Function.Module._load (internal/modules/cjs/loader.js:730:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
It's possible that the contents of your desktop are not what you think they are. Especially on a corporate device you might find that your desktop is actually at:
C:\Users\SamDavies\OneDrive - Your Organisation Name\Desktop\
I'd recommend using tab completion or a directory listing to verify that the hello-world.js is definitely in your current working directory.

Node JS error: Cannot find module '../build/jvm_dll_path.json'

I am receiving the following error after running npm start:
Error: Cannot find module '../build/jvm_dll_path.json'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/stature-gqdss/node_modules/java/lib
[nodemon] app crashed - waiting for file changes before starting...
Can you help me with this issue?
First, you should check if the server is already running and kill the existing server. If no other server is running, try reinstalling your dependencies and try again.
npm install
I have a hack here. You can simply create a file named jvm_dll_path.json inside node_modules\java\build and paste the path of server to this, between quotes like shown below..
";C:\\Program Files\\Java\\jdkX.X.X_XXX\\jre\\bin\\server"
For me running
node postInstall.js
in the node_modules/java folder worked.

Parse-Server Local Installation — external modules

I installed with success a Parse-Server on my local machine from this GUID.
I tried first with global installation, then I tried to understand better (It's the first time I see something related to Node.js) and I installed in a local directory. I think it should be the same.
this is what I done:
npm install parse-server parse-dashboard underscore
this is how the directory looks like:
/parse: ls
dashboard-config.json
logs
node_modules
ls node_modules/underscore
LICENSE
README.md
package.json
underscore-min.js
underscore-min.map
underscore.js
ls node_modules/parse
parse/
parse-dashboard/
parse-json/
parse-server/
parseurl/
Next I try to include also the cloud code I developed. the main.js has this content:
//var Image = require("parse-image");
var _ = require('underscore');
...
This is how I started the server:
node_modules/parse-server/bin/parse-server \
--appId APPID --masterKey MASTERKEY \
--databaseURI mongodb://localhost:27017/MyAPP \
--cloud /absolutepathfor/MyApp/cloud/main.js
and the error I got
module.js:341
throw err;
^
Error: Cannot find module 'underscore'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/Users/......./main.js:2:9)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
How can I include in this case underscore, but in any case other libraries?
[update]
I installed globally the underscore lib (node install -g underscore).
I create a symbolic link cloud -> < path where is located cloud/main.js >
Next I created package.json with npm init command
I launch again npm install
I created app.js like described in the guid and I configured it using the same parameters above.
I started the server with node app.js
all gone fine. the problem right now is in permissions on create a new document, where I should already have that grants, but this will be another problem to solve. I hope this can help somebody else
I hit the same problem and error message. I did the followings and it works
npm install underscore
use this path:
var _ = require('../node_modules/underscore/underscore.js')
Refer to more details in this post.
Can't get 'underscore' to work with parse server
I just sorted a similar issue while transferring Parse.com CloudCode to a self hosted Parse Server on Nodejs; in one of the controller we had the line
var _ = require('underscore.js');
It had to be done like this on Parse.com. But now as we are on NodeJS and have NPM—it's enough to just do:
var _ = require('underscore');
(ie: drop the .js extension)

Node.js NPM config error - " Error: Cannot find module './config/mail' "

Im following a book called "Building Node Applications with Mongo and Backbone". What im creating is a small social network site. Ive followed the steps through but am getting an error with npm config (I think)
when i run the app.js file it comes up with this error
> Error: Cannot find module './config/mail'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
this is the relevant code its referring to.
// Import the data layer
var config = {
mail: require('./config/mail')
};
Any suggestions on how to fix this? Thanks.
Try to install module with npm as admin in console: sudo npm install

Resources