How to use paypal-ipn module? - meteor

Whenever i click submit on the form that should send a notification to my listener, i get a message that says Cannot find module 'paypal-ipn'.
When i track the error, it takes me to a line of code ib the IPN listener var ipn = Meteor.npmRequire('paypal-ipn');
I added papal-ipn in my package.json here
{
"name": "application-name",
"version": "1.0.0",
"paypal-ipn" : "3.0.0",
"redis": "0.8.2",
"github": "0.1.8",
"body-parser": "1.14.1",
"description": "Application description.",
"scripts": {
"start": "meteor --settings settings-development.json",
"staging": "modulus env set METEOR_SETTINGS \"$(cat settings-development.json)\" -p 'Staging' && modulus deploy -f -p 'Staging'",
"production": "modulus env set METEOR_SETTINGS \"$(cat settings-production.json)\" -p 'Production' && modulus deploy -f -p 'Production'"
}
}
What is the mistake am doing? help PLEASE

ok try removing what you added to the package.json Run npm install --save paypal-ipn and that will add the required info to the package.json automatically for you.

Related

WordPress + BrowserSync + Local by Flywheel - CSS & JS Live Reload Workflow not working

I was trying to get this setup to work for a while and there is no support or similar issues over the web. There is actually one closed topic on Local community but no solution at all.
So, my setup is:
Local by Flywheel server for WordPress
VS Code with Node installed
#wordpress/scripts to bundle all my CSS and JS files
browser-sync to live reload
Here is my .json file:
{
"name": "mywebsite",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"live": "npm-run-all --parallel sync start",
"sync": "browser-sync start -p 'mywebsite.local' --files '**/*.php' 'build/*.js' 'build/*.css'",
"build": "wp-scripts build",
"start": "wp-scripts start",
"dev": "wp-scripts start",
"devFast": "wp-scripts start",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"#wordpress/scripts": "*",
"browser-sync": "^2.27.9",
"node-sass": "^7.0.1",
"normalize.css": "^8.0.1",
"npm-run-all": "^4.1.5"
}
}
So, the Browser Sync starts nicely in the command line, when starting it opens a new browser windows with this Error below.
There is nothing in the Local's log as they advice on this error screen.
Do anyone encounters similar problems and have the knowledge how to fix that?
I would be super grateful for any hints, walkarounds or solutions or maybe someone can share the other simple setup ideas to achieve the live reload functionality?
I had the same issue, it comes from the combination of npm-run-all and browser-sync. Instead of using npm-run-all, I used browser-sync as a webpack plugin.
Install browser-sync-webpack-plugin
npm install browser-sync-webpack-plugin -D
Then add browser-sync-webpack-plugin as plugin in your webpack.config.js file. As you use #wordpress/scripts, your config will be :
const defaultConfig = require( '#wordpress/scripts/config/webpack.config' );
const BrowserSyncPlugin = require('browser-sync-webpack-plugin')
module.exports = {
...defaultConfig,
plugins: [
...defaultConfig.plugins,
new BrowserSyncPlugin({
// browse to http://localhost:3000/ during development,
// ./public directory is being served
host: 'localhost',
port: 3000,
proxy: 'http://YOURDOMAIN.local/'
})
]
};
Take care to replace YOURDOMAIN.
Now when you run :
npm start
browser-sync will be automatically launched.

Deploy Storybook on Netlify with Nextjs

I am trying to deploy my Storybook on Netlify, I'm using Next.js framework but it fails every time and I don't know what is wrong
Netlify configuration :
Build command: npm run build-storybook
Publish directory: storybook-static
My package.json:
{
"homepage": "https://github.com/alexCoding42/tailwind-storybook",
"name": "tailwind-storybook",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"dependencies": {
"next": "10.0.9",
"react": "17.0.1",
"react-dom": "17.0.1"
},
"devDependencies": {
"#babel/core": "^7.13.10",
"#netlify/plugin-nextjs": "^3.0.3",
"#storybook/addon-actions": "^6.2.0-alpha.22",
"#storybook/addon-essentials": "^6.2.0-alpha.22",
"#storybook/addon-links": "^6.2.0-alpha.22",
"#storybook/react": "^6.2.0-alpha.22",
"#types/node": "^14.14.35",
"#types/react": "^17.0.3",
"babel-loader": "^8.2.2",
"gh-pages": "^3.1.0",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.2.1",
"tailwindcss": "^2.0.4",
"typescript": "^4.2.3"
}
}
The error I get on Netlify:
Plugin "#netlify/plugin-nextjs" internal error
Error: No static assets found in .next dist (aka no /.next/static). Please check your project configuration. Your next.config.js must be one of serverless or experimental-serverless-trace. Your build command should include next build.
I have also tried to add a netlify.toml at the root of my project with this config:
[build]
command = "npm run build-storybook"
publish = "storybook-static"
[[plugins]]
package = "#netlify/plugin-nextjs"
And added #netlify/plugin-nextjsas dev dependency of package.json but I get the same error...
Can someone help me on this please ?
I had a similar problem but not with the storybook but with nx + nextjs.
If I tried to deploy the app to the netlify I got the same error.
So I changed next.config.js in the root directory and add to distDir path to generated .static folder and it's working now.
and this is my netlify.toml ss
The Netlify Next.js plugin isn't required for a Storybook build. In fact, no plugins are required; the only configuration needed is, as OP says:
Build command: npm run build-storybook
Publish directory: storybook-static
Or, in netlify.toml:
[build]
command = "npm run build-storybook"
publish = "storybook-static"
No [[plugins]] fields are needed.
If Netlify is configured through the UI, go to https://app.netlify.com/sites/my-awesome-site/plugins and remove the Next.JS plugin.

Task Runner Explorer ASP.NET - Block-scoped declarations not yet supported outside strict mode

I have been getting this error for days now and I am not sure how to fix it.
When I run the "dev" package in Node Task Runner Explorer it gives this error.
It seems to be something to do with different versions of node and webpack not getting along. the error message, and my packages.json file are below, as is the link to the article I am working through.
setting-up-a-react-environment-for-aspnet-mvc-44la
Error Message
C:\DevFolder\MyApplication> cmd.exe /c npm run dev --color=always
asp.net#1.0.0 dev C:\DevFolder\MyApplication
webpack --mode development --watch C:\DevFolder\MyApplication\node_modules\webpack\bin\webpack.js:90 let
notify = ^^^ SyntaxError: Block-scoped declarations (let, const,
function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:430:10)
at startup (node.js:141:18)
at node.js:980:3 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! asp.net#1.0.0 dev: `webpack --mode development --watch` npm ERR!
Exit status 1 npm ERR! npm ERR! Failed at the asp.net#1.0.0 dev
script. npm ERR! This is probably not a problem with npm. There is
likely additional logging output above.
package.json
{
"version": "1.0.0",
"name": "asp.net",
"private": true,
"scripts": {
"build": "webpack",
"dev": "webpack --mode development --watch"
},
"devDependencies": {
"#babel/cli": "^7.7.5",
"#babel/core": "^7.7.5",
"#babel/plugin-proposal-class-properties": "^7.7.4",
"#babel/preset-env": "^7.7.6",
"#babel/preset-react": "^7.7.4",
"babel-loader": "^8.0.6",
"browser-sync": "^2.26.7",
"browser-sync-webpack-plugin": "^2.2.2",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-notifier": "^1.8.0"
},
"dependencies": {
"react": "^16.12.0",
"react-dom": "^16.12.0",
"npm": "6.12.1",
"node" : "5.3.0"
}
}
Webpack Config
"use strict";
var path = require("path");
var WebpackNotifierPlugin = require("webpack-notifier");
var BrowserSyncPlugin = require("browser-sync-webpack-plugin");
module.exports = {
entry: "./Scripts/ApplicationReact/ApplicationReact.js",
output: {
path: path.resolve(__dirname, "./Scripts/"),
filename: "bundle.js"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
]
},
devtool: "inline-source-map",
plugins: [new WebpackNotifierPlugin(), new BrowserSyncPlugin()]
};
Summary
Don't install the Node.js nuget package, it breaks your project and it will remain broken after you have removed it. Just let the general installation of node do the work.
Detail
When in any other directory, if I did "node -v" in the command line and it would return version 12.13.1
When in my project folder if I did "node -v" it would return 5.3.0
When I removed the Node.js nuget package I thought it would default to the system version but instead it just said "cannot find the file or command specified" (or something along those lines).
I had copied the whole of our software to another folder for the purposes of this exercise. I just branched to another folder and this time the "node -v" was coming back with 12.13.1
I carried on with the exercise and the error did not appear. I am not sure how to fix it once you get into this state.
Better answers?
This isn't a great answer and I won't mark it as the answer. If anyone can provide a plausible explanation for what is going on here, and a way to cure your project from the nuget node lurgy, I will mark it as the answer.

Cannot run dev on nextjs nodemon

I'm using nodemon with the following configuration in nodemon.json.
{
"verbose": true,
"ignore": ["node_modules", ".next", "app/"],
"watch": ["app.js"]
}
I'm using this booilerplate with follwing configuration in package.json.
"build": "cd app && next build",
"start": "npm run build && env NODE_ENV=production node app.js -p >$PORT",
"learn": "npm run build && env NODE_ENV=production node app.js",
"dev": "nodemon -w app.js app.js"
Once I run npm run dev, I'm getting following output.
Using "webpackDevMiddleware" config function defined in
next.config.js. Using external babel configuration Location:
"/home/shintaro/Desktop/projects/frontend/app/.babelrc"
and the server never starts...

My sqlite3 rebuild generates the electron-v1.4-win32-x64 and require asks for electron-v1.4-win32-ia32 . Does any have idea?

This are the snap of the app and the snap of the compiled node file
I got the solution.
We are getting wrong build because we are using the 32bit version of nodejs in 64bit arch.
You can verify the arch of your nodejs by using the process.
c:\> node
> process
Search for target_arch
If there written 32 than goto the nodejs.org and download the 64bit installer of the nodejs.
Step to follow
Remove the node_modules folder
Open command prompt (run as admin)
Check the node process arch type is x64 shown in image.
run npm install
My package.json file
{
"name": "sqlite",
"version": "1.0.0",
"description": "This is the tutorial for the sqllite",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "electron .",
"rebuild": "electron-rebuild -f -w sqlite3"
},
"author": "",
"license": "ISC",
"dependencies": {
"electron-prebuilt": "^1.4.13",
"sqlite3": "^3.1.8"
},
"devDependencies": {
"electron-rebuild": "^1.5.10"
}
}

Resources