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

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?

Related

How can I solve "Cannot find module" using Yarn?

I'm trying to deploy a nextjs project that I've updated to version 13.when I deploy the following error occurs:
> Build error occurred
Error: Cannot find module 'picocolors'
Require stack:
- C:\Users\Arotiana's\portfolio-react\node_modules\next\node_modules\postcss\lib\css-syntax-
error.js
- C:\Users\Arotiana's\portfolio-react\node_modules\next\node_modules\postcss\lib\postcss.js
- C:\Users\Arotiana's\portfolio-react\node_modules\next\dist\build\webpack\plugins\font-
stylesheet-gathering-plugin.js
- C:\Users\Arotiana's\portfolio-react\node_modules\next\dist\build\webpack-config.js
- C:\Users\Arotiana's\portfolio-react\node_modules\next\dist\build\index.js
- C:\Users\Arotiana's\portfolio-react\node_modules\next\dist\cli\next-build.js
- C:\Users\Arotiana's\portfolio-react\node_modules\next\dist\lib\commands.js
- C:\Users\Arotiana's\portfolio-react\node_modules\next\dist\bin\next
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at mod._resolveFilename (C:\Users\Arotiana's\portfolio-
react\node_modules\next\dist\build\webpack\require-hook.js:23:32)
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 Object.<anonymous> (C:\Users\Arotiana's\portfolio-
react\node_modules\next\node_modules\postcss\lib\css-syntax-error.js:3:12)
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: [
"C:\\Users\\Arotiana's\\portfolio-
react\\node_modules\\next\\node_modules\\postcss\\lib\\css-syntax-error.js",
"C:\\Users\\Arotiana's\\portfolio-
react\\node_modules\\next\\node_modules\\postcss\\lib\\postcss.js",
"C:\\Users\\Arotiana's\\portfolio-
react\\node_modules\\next\\dist\\build\\webpack\\plugins\\font-stylesheet-gathering-
plugin.js",
"C:\\Users\\Arotiana's\\portfolio-react\\node_modules\\next\\dist\\build\\webpack-
config.js",
"C:\\Users\\Arotiana's\\portfolio-react\\node_modules\\next\\dist\\build\\index.js",
"C:\\Users\\Arotiana's\\portfolio-react\\node_modules\\next\\dist\\cli\\next-build.js",
"C:\\Users\\Arotiana's\\portfolio-react\\node_modules\\next\\dist\\lib\\commands.js",
"C:\\Users\\Arotiana's\\portfolio-react\\node_modules\\next\\dist\\bin\\next"
]
}
I've already try tried to install picocolors but when I deploy this error alwais comes. How can I solve it?

Error: Cannot find module './internal/re'

PS C:\Users\QHTF\Desktop\Statistics> npm
node:internal/modules/cjs/loader:985
const err = new Error(message);
^
Error: Cannot find module './internal/re'
Require stack:
C:\Users\QHTF\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js
C:\Users\QHTF\AppData\Roaming\npm\node_modules\npm\lib\cli.js
C:\Users\QHTF\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.Module._load (node:internal/modules/cjs/loader:833:27)
at Module.require (node:internal/modules/cjs/loader:1057:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (C:\Users\QHTF\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js:2:20)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Module.require (node:internal/modules/cjs/loader:1057:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\QHTF\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js',
'C:\Users\QHTF\AppData\Roaming\npm\node_modules\npm\lib\cli.js',
'C:\Users\QHTF\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js'
]
}
First you need to install modules according to your node project. It should be very convenient if you use any control panel. You can install it from Module(s)>Manage section.

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)

"Cannot find module 'libnpx'" error when npx mix command is run

I have recently started learning and attempting to use the npx mix commands but whenever I try to execute the command it returns this error:
node:internal/modules/cjs/loader:949
throw err;
^
Error: Cannot find module 'libnpx'
Require stack:
- /usr/share/npm/bin/npx-cli.js
at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
at Module._load (node:internal/modules/cjs/loader:787:27)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/share/npm/bin/npx-cli.js:3:13)
at Module._compile (node:internal/modules/cjs/loader:1112:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:834:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/share/npm/bin/npx-cli.js' ]
}
I am not sure how to fix this problem - any help with solving this would be greatly appreciated!

Getting error while running npm-check-updates

I am getting below error while trying to execute below command
npm-check-updates
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module '../../package.json'
Require stack:
C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js:11:40)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js'
]
}
I see the location C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js exist. Can you help me solving this error?
I found the workaround in location https://github.com/raineorshine/npm-check-updates/issues/990
I changed "../../package.json" to "../../../package.json" in /home/ledsun/.local/share/nvm/v17.0.1/lib/node_modules/npm-check-updates/build/src/bin/cli.js:11, then the ncu runs expected.

Resources