Categories
Mastering Development

Testing NodeJS with Mocha: ‘Require is not defined’

I have a very simple Node file that I’m trying to test with Mocha/Chai. The actual code is trivial, this is just to learn a bit about Mocha and how to use it. But when I run the Mocha test, I get the error ERROR: ReferenceError: require is not defined ` I did some googling […]

Categories
Cryptocurrency Ethereum Mastering Development

Cannot Deploy to Rinkeby using Truffle, Infura, and Node

I am trying to deploy a contract to Rinkeby using Node and Truffle but I get a lengthy error: Truncated Error: Attempting to deploy from account ‘MYACCOUNT#’ [object Object] [object Object] //… error body is too long to fit ^ RuntimeError: abort([object Object]).Build with – s ASSERTIONS = 1 for more info. at process.abort(/Users/ntg / […]

Categories
Cryptocurrency Ethereum Mastering Development

Deploying ERC20 Error

I’d like to deploy follow "StandardERC20" token to kovan test net using Truffle. I want to deploy same contract like "https://etherscan.io/address/0x69d9905b2e5f6f5433212b7f3c954433f23c1572#code" to kovan. But I got follow errors. I added error log and some files needed to deploy this token. And I found that error is in "ServiceReceiver(receiver).pay{value: msg.value}(serviceName);" of ServicePayer.sol. last address parameter of […]

Categories
Cryptocurrency Ethereum Mastering Development

Error while compiling compile.js: Please verify that the package.json has a valid “main” entry

I’m trying to compile a compile.js file and got the error shown below. I was using the command "node compile.js". I do not understand what does this error mean. internal/modules/cjs/loader.js:329 throw err; ^ Error: Cannot find module ‘/Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/solc/index.js’. Please verify that the package.json has a valid "main" entry at tryPackage (internal/modules/cjs/loader.js:321:19) at Function.Module._findPath (internal/modules/cjs/loader.js:682:18) at […]

Categories
Mastering Development

How do I use Babel with Electron, and can Nodemon be used too?

I’ve been using Node for years but I never had a reason to look at Babel until I wanted to build an Electron app with ES6 import syntax and found Electron is frustratingly behind the times. So I learned about this magical solution only to discover it was no longer maintained. So Babel to the […]

Categories
Mastering Development

React and Node application not uploading Images to Cloudinary, 404 error with no explanation

I am trying to upload an image to cloudinary. I am using this resource as my tutorial… I am able to render a preview of the image onto my screen and I console log the base64 encoded url, and it works as it is supposed to. After I select my Image, I hit upload and […]

Categories
Mastering Development

Issue with setting up webpack

So I managed to install webpack, however when I run npm start from the folder where my webpack.config.js is, I am getting a bunch of errors that modules are not found like stream, buffer etc. although I see they are in the node_modules, added by npm init and modules I installed via npm. I followed […]

Categories
Mastering Development

Heroku deploy error : Cannot find module ‘Express’

I am trying to deploy a Node.js app on heroku. But whenever I try to deploy it throws error – Cannot find module "Express". Despite already being mentioned in package.json file, it is still throwing the error. I have followed every step mentioned in Heroku Node.js docs and looked up the problem everywhere and did […]

Categories
Mastering Development

with npm install, how to avoid installing dependencies of dependencies

here is my package.json . Taken from https://github.com/yigalirani/react_webpack_babel { "name": "react_webpack_babel", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack-dev-server –open –hot –mode development", "build": "webpack –mode production" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@babel/core": "^7.5.0", "@babel/preset-env": "^7.5.0", "@babel/preset-react": "^7.0.0", "babel-loader": "^8.0.6", […]

Categories
Mastering Development

Vuetify SassError: Expected identifier

Error in sass files Vuetify inside. I tried to put the dependency below the version, it did not help. What to do about it? ERROR in ./node_modules/vuetify/src/styles/main.sass (./node_modules/css-loader/dist/cjs.js??ref–6-oneOf-1-1!./node_modules/postcss-loader/src??ref–6-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref–6-oneOf-1-3!./node_modules/sass-resources-loader/lib/loader.js??ref–6-oneOf-1-4!./node_modules/vuetify/src/styles/main.sass) Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Expected identifier. ╷ 34 │ .v-application .red.#E82550{ │ ^ ╵ node_modules/vuetify/src/styles/generic/_colors.scss 34:29 @import node_modules/vuetify/src/styles/generic/_index.scss 2:9 @import node_modules/vuetify/src/styles/main.sass 38:9 root stylesheet Please, […]