Heroku App Crashing with Syntax Error for Hoek - node.js

I'm trying to build the Slack app found here: https://github.com/shaykalyan/slack-ascii
It builds successfully, but gives this output when I try to run it:
2018-02-14T16:21:18.323723+00:00 heroku[web.1]: Starting process with command `node index.js`
2018-02-14T16:21:20.151317+00:00 heroku[web.1]: State changed from starting to crashed
2018-02-14T16:21:20.137708+00:00 heroku[web.1]: Process exited with status 1
2018-02-14T16:21:20.085005+00:00 app[web.1]: /app/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
2018-02-14T16:21:20.085023+00:00 app[web.1]: const Hoek = require('hoek');
2018-02-14T16:21:20.085025+00:00 app[web.1]: ^^^^^
2018-02-14T16:21:20.085027+00:00 app[web.1]: SyntaxError: Use of const in strict mode.
2018-02-14T16:21:20.085028+00:00 app[web.1]: at exports.runInThisContext (vm.js:73:16)
2018-02-14T16:21:20.085030+00:00 app[web.1]: at Module._compile (module.js:443:25)
2018-02-14T16:21:20.085032+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)
2018-02-14T16:21:20.085034+00:00 app[web.1]: at Module.load (module.js:355:32)
2018-02-14T16:21:20.085035+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2018-02-14T16:21:20.085037+00:00 app[web.1]: at Module.require (module.js:365:17)
2018-02-14T16:21:20.085038+00:00 app[web.1]: at require (module.js:384:17)
2018-02-14T16:21:20.085040+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/request/node_modules/hawk/lib/index.js:5:33)
2018-02-14T16:21:20.085042+00:00 app[web.1]: at Module._compile (module.js:460:26)
2018-02-14T16:21:20.085043+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)

Related

How to fix the problem when running"npx task createFieldSources"?

I follow the instructions in https://github.com/iden3/rapidsnark to complile the code.
When I try to run "npx task createFieldSources" in my ubuntu in wsl, I get the following errors:
superduper#DESKTOP-PC181T0:/mnt/d/github/4.prove_verify/circuits$ npm install
added 1 package, and audited 2 packages in 3s
found 0 vulnerabilities
superduper#DESKTOP-PC181T0:/mnt/d/github/4.prove_verify/circuits$ git submodule init
superduper#DESKTOP-PC181T0:/mnt/d/github/4.prove_verify/circuits$ git submodule update
superduper#DESKTOP-PC181T0:/mnt/d/github/4.prove_verify/circuits$ npx task createFieldSources
Error: Cannot find module './uws_linux_108'
Require stack:
- /home/superduper/.npm/_npx/366785b987801bcc/node_modules/hub.js/dist/index.js
- /home/superduper/.npm/_npx/366785b987801bcc/node_modules/task/src/index.js
- /home/superduper/.npm/_npx/366785b987801bcc/node_modules/task/bin/cmd.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at /home/superduper/.npm/_npx/366785b987801bcc/node_modules/hub.js/dist/index.js:239:14
at Object.<anonymous> (/home/superduper/.npm/_npx/366785b987801bcc/node_modules/hub.js/dist/index.js:244:3)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/superduper/.npm/_npx/366785b987801bcc/node_modules/hub.js/dist/index.js',
'/home/superduper/.npm/_npx/366785b987801bcc/node_modules/task/src/index.js',
'/home/superduper/.npm/_npx/366785b987801bcc/node_modules/task/bin/cmd.js'
]
}
/home/superduper/.npm/_npx/366785b987801bcc/node_modules/hub.js/dist/index.js:246
$197449592_native.setNoop($197449592_noop)
^
TypeError: Cannot read properties of undefined (reading 'setNoop')
at Object.<anonymous> (/home/superduper/.npm/_npx/366785b987801bcc/node_modules/hub.js/dist/index.js:246:19)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/home/superduper/.npm/_npx/366785b987801bcc/node_modules/task/src/index.js:1:11)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
Node.js v18.12.1
How could I fix them?

Npm not installing after updating and getting TypeError

when I check the node version and npm version in my nodejs terminal everything appears to be working fine. When I try doing something in VS code and run the, "npm -v", I get all this stuff below. I tried opening the folder via powershell and running npm -v but get the same stuff.
Node version is showing: v16.17.0
C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110
class SocksProxyAgent extends agent_base_1.Agent {
^
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110
class SocksProxyAgent extends agent_base_1.Agent {
^
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1126:14)

When I write "npm start" terminal is showing bindings error

this is the error i get after running npm start
> tictactoe#0.1.0 start
> parcel index.html
D:\courses\TicTacToe\node_modules\bindings\bindings.js:126
err = new Error(
^
Error: Could not locate the bindings file. Tried:
→ D:\courses\TicTacToe\node_modules\deasync\lib\binding\node-v93-win32-x64\deasync.node
at bindings (D:\courses\TicTacToe\node_modules\bindings\bindings.js:126:9)
at Object.<anonymous> (D:\courses\\TicTacToe\node_modules\deasync\index.js:30:31)
at Module._compile (D:\courses\TicTacToe\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (D:\courses\TicTacToe\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (D:\courses\TicTacToe\node_modules\parcel\src\utils\syncPromise.js:1:79)
at Module._compile (D:\courses\TicTacToe\node_modules\v8-compile-cache\v8-compile-cache.js:192:30) {
I tried installed npm again, but same error.

npx create-react-app fails with error "cannot find module block-stream

$ npx create-react-app counter
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'block-stream'
Require stack:
C:\Users\theop\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\tar\lib\entry-writer.js
C:\Users\theop\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\tar\lib\pack.js
C:\Users\theop\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\tar\tar.js
C:\Users\theop\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\node_modules\tar-pack\index.js
C:\Users\theop\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js
C:\Users\theop\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Users\theop\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\tar\lib\entry-writer.js:7:19)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\theop\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\tar\lib\entry-writer.js',
'C:\Users\theop\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\tar\lib\pack.js',
'C:\Users\theop\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\tar\tar.js',
'C:\Users\theop\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\node_modules\tar-pack\index.js',
'C:\Users\theop\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js',
'C:\Users\theop\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\index.js'
]
}
I thought you installed block-stream first
npm init && npm i block-stream && npx create-react-app counter
or using vite
npm create vite#latest my-vue-app -- --template react

Node.JS app crash on startup after second deployment on Heroku

I did git push heroku master for the second time.
But I got the error cannot find module ....
For the first time, I succeeded.
How can I fix this? Thanks.
2021-01-03T16:03:35.301824+00:00 app[web.1]: internal/modules/cjs/loader.js:818
2021-01-03T16:03:35.301837+00:00 app[web.1]: throw err;
2021-01-03T16:03:35.301837+00:00 app[web.1]: ^
2021-01-03T16:03:35.301837+00:00 app[web.1]:
2021-01-03T16:03:35.301838+00:00 app[web.1]: Error: Cannot find module './stringToParts'
2021-01-03T16:03:35.301838+00:00 app[web.1]: Require stack:
2021-01-03T16:03:35.301839+00:00 app[web.1]: - /app/node_modules/mpath/lib/index.js
2021-01-03T16:03:35.301839+00:00 app[web.1]: - /app/node_modules/mpath/index.js
2021-01-03T16:03:35.301839+00:00 app[web.1]: - /app/node_modules/mongoose/lib/utils.js
2021-01-03T16:03:35.301840+00:00 app[web.1]: - /app/node_modules/mongoose/lib/statemachine.js
2021-01-03T16:03:35.301841+00:00 app[web.1]: - /app/node_modules/mongoose/lib/internal.js
2021-01-03T16:03:35.301841+00:00 app[web.1]: - /app/node_modules/mongoose/lib/document.js
2021-01-03T16:03:35.301841+00:00 app[web.1]: - /app/node_modules/mongoose/lib/index.js
2021-01-03T16:03:35.301842+00:00 app[web.1]: - /app/node_modules/mongoose/index.js
2021-01-03T16:03:35.301842+00:00 app[web.1]: - /app/models/user.js
2021-01-03T16:03:35.301843+00:00 app[web.1]: - /app/controllers/usersController.js
2021-01-03T16:03:35.301843+00:00 app[web.1]: - /app/routes/userRoutes.js
2021-01-03T16:03:35.301844+00:00 app[web.1]: - /app/routes/index.js
2021-01-03T16:03:35.301845+00:00 app[web.1]: - /app/main.js
2021-01-03T16:03:35.301845+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
2021-01-03T16:03:35.301846+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:667:27)
2021-01-03T16:03:35.301846+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:887:19)
2021-01-03T16:03:35.301847+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:74:18)
2021-01-03T16:03:35.301847+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/mpath/lib/index.js:1:21)
2021-01-03T16:03:35.301848+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:999:30)
2021-01-03T16:03:35.301848+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
2021-01-03T16:03:35.301849+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:863:32)
2021-01-03T16:03:35.301849+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:708:14)
2021-01-03T16:03:35.301849+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:887:19) {
2021-01-03T16:03:35.301850+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2021-01-03T16:03:35.301850+00:00 app[web.1]: requireStack: [
2021-01-03T16:03:35.301851+00:00 app[web.1]: '/app/node_modules/mpath/lib/index.js',
2021-01-03T16:03:35.301851+00:00 app[web.1]: '/app/node_modules/mpath/index.js',
2021-01-03T16:03:35.301851+00:00 app[web.1]: '/app/node_modules/mongoose/lib/utils.js',
2021-01-03T16:03:35.301852+00:00 app[web.1]: '/app/node_modules/mongoose/lib/statemachine.js',
2021-01-03T16:03:35.301852+00:00 app[web.1]: '/app/node_modules/mongoose/lib/internal.js',
2021-01-03T16:03:35.301852+00:00 app[web.1]: '/app/node_modules/mongoose/lib/document.js',
2021-01-03T16:03:35.301853+00:00 app[web.1]: '/app/node_modules/mongoose/lib/index.js',
2021-01-03T16:03:35.301853+00:00 app[web.1]: '/app/node_modules/mongoose/index.js',
2021-01-03T16:03:35.301853+00:00 app[web.1]: '/app/models/user.js',
2021-01-03T16:03:35.301854+00:00 app[web.1]: '/app/controllers/usersController.js',
2021-01-03T16:03:35.301854+00:00 app[web.1]: '/app/routes/userRoutes.js',
2021-01-03T16:03:35.301855+00:00 app[web.1]: '/app/routes/index.js',
2021-01-03T16:03:35.301855+00:00 app[web.1]: '/app/main.js'
2021-01-03T16:03:35.301855+00:00 app[web.1]: ]
2021-01-03T16:03:35.301856+00:00 app[web.1]: }
2021-01-03T16:03:35.394395+00:00 heroku[web.1]: Process exited with status 1
2021-01-03T16:03:35.475189+00:00 heroku[web.1]: State changed from starting to crashed
2021-01-03T16:03:35.479175+00:00 heroku[web.1]: State changed from crashed to starting
2021-01-03T16:03:39.720428+00:00 heroku[web.1]: Starting process with command `node main.js`
Are you exporting the data in './stringToParts' correctly?
When you require a module like './stringToParts', it must be exported.
Check if you have something like this at the end of your './stringToParts' file:
module.exports = function;

Resources