Error: Cannot find module code: 'MODULE_NOT_FOUND', (metaplex) - solana

im heaving trouble uploading my NFT to the devnet in solana using metaplex cli
im following a tutorial on buildspace: https://buildspace.so/p/ship-solana-nft-collection/
(should be noted! im using WSL)
i followed as instructed and when i needed to upload my nfts throught metaplex i ran the command:
ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload -e devnet -k ~/.config/solana/devnet.json -cp config.json ./assets
and then this eror pops up:
==========================================================================================
wallet public key: HAMgtaBZBZM8U1AJ5BGMDEcmoLqCzqL7mu9BU2kgrzCN
(node:12137) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use node --trace-warnings ... to show where the warning was created)
(node:12137) UnhandledPromiseRejectionWarning: Error: Non-base58 character
at Object.decode (/home/deathsn1per/metaplex/js/node_modules/base-x/src/index.js:111:11)
at new PublicKey (/home/deathsn1per/metaplex/js/node_modules/#solana/web3.js/src/publickey.ts:56:30)
at getCandyMachineV2Config (/home/deathsn1per/metaplex/js/packages/cli/src/helpers/various.ts:164:9)
at Command. (/home/deathsn1per/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:157:38)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:12137) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:12137) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
=========================================================================================
i proceeded to inspect where the warning came from using:
node --trace-warnings ...
and it showed me this:
=======================================================================================
Error: Cannot find module '/home/deathsn1per/Projects/solanaXreact/nft-drop-starter-project/...'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
=========================================================================================
i thought maybe something wrong with the way installed metaplex, so i deleted every thing and re installed but nothing..
i installed metaplex files in home/deathsn1per/metaplex...
from what little i understand this is a problem with the modules, something went wrong with the installetion but i cant figure out what is it...
so im kinda lost as where to look even. or what to do to fix it, any help would be very nice!
i hope i provided with enough info (if needed more info pls dont kill just tell me what you need to know ;) )

The tutorial is way outdated. The tool that you are trying to use is deprecated and not supported anymore.
You should be using sugar instead which is a cli that is way faster and more reliable than the old js cli.
You can find a tutorial on the official docs here:
https://docs.metaplex.com/developer-tools/sugar/tutorials/my-first-candy-machine

Related

Angular 12: ng serve --open takes too long and have a lot of message

So I have a previous problem with my angular 12 you can click here for reference
So I kinda fix it now and I can do ng serve --open, but I got this message, maybe an error and it never serve or show the output its just it takes a lot of time.
ERROR:
D:\3rdYR\AppDev\bigProject\public>ng serve public
⠙ Generating browser application bundles (phase: setup)...(node:12832) UnhandledPromiseRejectionWarning: Error: The Angular Compiler requires TypeScript >=4.4.2 and <4.5.0 but 4.3.5 was found instead.
at checkVersion (file:///D:/3rdYR/AppDev/bigProject/public/node_modules/#angular/compiler-cli/bundles/index.js:17440:11)
at verifySupportedTypeScriptVersion (file:///D:/3rdYR/AppDev/bigProject/public/node_modules/#angular/compiler-cli/bundles/index.js:17444:3)
at new NgtscProgram (file:///D:/3rdYR/AppDev/bigProject/public/node_modules/#angular/compiler-cli/bundles/index.js:17594:7)
at AngularWebpackPlugin.updateAotProgram (D:\3rdYR\AppDev\bigProject\public\node_modules\#angular-devkit\build-angular\node_modules\#ngtools\webpack\src\ivy\plugin.js:321:32)
at D:\3rdYR\AppDev\bigProject\public\node_modules\#angular-devkit\build-angular\node_modules\#ngtools\webpack\src\ivy\plugin.js:198:24
at Hook.eval [as call] (eval at create (D:\3rdYR\AppDev\bigProject\public\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:24:1)
at Hook.CALL_DELEGATE [as _call] (D:\3rdYR\AppDev\bigProject\public\node_modules\tapable\lib\Hook.js:14:14)
at Compiler.newCompilation (D:\3rdYR\AppDev\bigProject\public\node_modules\webpack\lib\Compiler.js:1054:30)
at D:\3rdYR\AppDev\bigProject\public\node_modules\webpack\lib\Compiler.js:1099:29
at eval (eval at create (D:\3rdYR\AppDev\bigProject\public\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12832) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:12832) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠼ Generating browser application bundles (phase: setup)...
Right now it is still generating but it is like going on like that for 10 minutes at least.
You have a wrong typescript version installed in your Project.
UnhandledPromiseRejectionWarning: Error: The Angular Compiler requires TypeScript >=4.4.2 and <4.5.0 but 4.3.5 was found instead.
Change in your Package Json your Typescript version to 4.4.2 and npm install than try ng serve again :)

"token does not exist"

Hello and good afternoon all!
I have a problem with ASK CLI in that when I attempt to utilize "ask clone " it returns this error in my console:
ask clone amzn1.ask.skill.900c47d3-532f-45b5-975b-1c995c6dbd88
The property "token" does not exist.
/usr/local/lib/node_modules/ask-cli/node_modules/simple-oauth2/lib/client/access-token.js:21
if ('expires_at' in this.token) {
^
TypeError: Cannot use 'in' operator to search for 'expires_at' in undefined
at new AccessToken (/usr/local/lib/node_modules/ask-cli/node_modules/simple-oauth2/lib/client/access-token.js:21:22)
at Object.createAccessToken [as create] (/usr/local/lib/node_modules/ask-cli/node_modules/simple-oauth2/lib/client/access-token.js:38:12)
at isTokenExpired (/usr/local/lib/node_modules/ask-cli/lib/utils/oauth-wrapper.js:97:35)
at Object.tokenRefreshAndRead (/usr/local/lib/node_modules/ask-cli/lib/utils/oauth-wrapper.js:84:10)
at Object.module.exports.requestWithUrl (/usr/local/lib/node_modules/ask-cli/lib/api/request-wrapper.js:45:18)
at Object.module.exports.request (/usr/local/lib/node_modules/ask-cli/lib/api/request-wrapper.js:26:20)
at Object.callGetSkillStatus (/usr/local/lib/node_modules/ask-cli/lib/api/api-wrapper.js:229:20)
at Command.handle (/usr/local/lib/node_modules/ask-cli/lib/api/skill.js:213:20)
at Command.listener (/usr/local/lib/node_modules/ask-cli/node_modules/commander/index.js:315:8)
at Command.emit (events.js:182:13)
at Command.parseArgs (/usr/local/lib/node_modules/ask-cli/node_modules/commander/index.js:654:12)
at Command.parse (/usr/local/lib/node_modules/ask-cli/node_modules/commander/index.js:474:21)
at Object. (/usr/local/lib/node_modules/ask-cli/bin/ask-api.js:25:6)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
I have scoured the Earth for solutions and found one way to bypass this is to "downgrade" the oauth from '1.0.2' to '1.5.0' however this does not seem to work.
Any input/suggestions on this?
I had this problem a while ago. I uninstalled the cli and followed this tutorial to setup ASK-CLI and it worked.
When the ASK-CLI is installed for the first time it needs configuration with our aws account and amazon account. Sometimes our accounts are not get configured properly and results in problems in cloning and deploying the skill. It happen because the authentication token of CLI does not match with our accounts.
Solution:
Try running ask init command again. And If this does not work
Uninstall the ASK-CLI and install again. And Run ask init

Error when running `feathers generate authentication` for `RethinkDB`

I’m having issues when running feathers generate authentication with selecting rethinkdb as database.
Environment:
Mac OS X Sierra
feathers 2.2.3
npm 5.1.0
rethinkdb 2.3.5
Steps to reproduce:
I have up and running https://github.com/tenzan/feathers-chat.git
feathers generate authentication
Select Username + Password (Local)
What is the name of the user (entity) service? (users) <-- Enter
What kind of service is it? (Use arrow keys) ❯ RethinkDB <-- Enter
Output:
events.js:182
throw er; // Unhandled 'error' event
^
TypeError: Parameter "url" must be a string, not object
at Url.parse (url.js:102:11)
at Object.urlParse [as parse] (url.js:96:5)
at ConnectionGenerator._getConfiguration (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:46:24)
at ConnectionGenerator._writeConfiguration (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:103:32)
at ConnectionGenerator.writing (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:297:10)
at Object.<anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:417:23)
at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:24:19
at /usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:418:9
I had same errors on different Mac PCs with same environment.
It's an issue with generator-feathers
Remove the rethinkdb object from config/default
will see if I can fix the main problem
Edit: Fixed

Cannot run in production mode

I have a donejs application and its running ok in development mode donejs develop, but when I run it in production mode:
donejs build
donejs deploy (to firebase)
NODE_ENV=production donejs start
it will not start and show an error (see CODE A)
This file: file:my-app/dist/bundles/my-app/index.js:704 corresponds to JQuery 3.x and its not a dependency of the project itself but a dependency of can-connect-feathers (https://github.com/canjs/can-connect-feathers). In fact in index.js there is also included JQuery 2.x what makes me think there might be some sort of incompatibility among them.
I already tried changing the project's dependency to JQuery 3.x but didn't help. Actually it will make even donejs develop fail (see CODE B).
I also tried the following:
cd my-app/node_modules/steal
npm install
but didn't help, another error appears and finally tried cd my-app/node_modules/can && npm install but that end up in multiple errors.
I'm using:
donejs#0.9.2
node#4.6.2
npm#2.15.11
can-connect-feathers#1.2.1
CODE A
NODE_ENV=production donejs start
my-app#0.0.0 start my-app
done-serve --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [5] TypeError: Error loading "package.json!npm" at file:my-app/package.json
Error loading "bundles/my-app/index" at file:my-app/dist/bundles/my-app/index.js
Error evaluating file:my-app/dist/bundles/my-app/index.js
Cannot read property 'createElement' of undefined
at i (file:my-app/dist/bundles/my-app/index.js:704:20)
at file:my-app/dist/bundles/my-app/index.js:1039:2881
at file:my-app/dist/bundles/my-app/index.js:1039:3580
at file:my-app/dist/bundles/my-app/index.js:268:21
at file:my-app/dist/bundles/my-app/index.js:268:27
at Object.exports.runInThisContext (vm.js:54:17)
at doEval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:2059:10)
at __eval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1976:7)
at Loader.exec [as __exec] (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:339:5)
at Loader.loader.instantiate (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1517:16)
CODE B
donejs develop
my-app#0.0.0 develop my-app
done-serve --develop --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [8] Error: Error loading "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at <unknown>
Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "done-autorender#0.8.0#autorender" at file:my-app/node_modules/done-autorender/src/autorender.js
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
Potentially unhandled rejection [16] Error: Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at file:my-app/src/index.stache
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
If the double jQuery installation is the issue, it should be resolved by version 2.0.0, which is exactly the same as the 1.0 version, but requires that you pass in a jQuery package as the jquery option. So, in addition to whatever else you had in your can-connect-feathers config, you'll need to provide the jquery option:
import $ from 'jquery'
import Feathers from 'can-connect-feathers';
new Feathers({
jquery: $
});

Switching NodeJs application to debug mode from within it's process

I have a NodeJs module "some-module" that I want to have installed globally so it can be run directly from the command line without the node executable prefix. ie: $> some-module [args] I would like one of those arguments to be --debug. The reasoning for this is that I don't want to require users of this module to install it to their local directory just to run node --debug-brk node_modules/some-module/[path to entry point] [args].
The NodeJs documentation states in it's advanced usages section on debugging (http://nodemanual.org/latest/nodejs_ref_guide/debugging.node.js.html)
The V8 debugger can be enabled and accessed either by starting Node.js with the --debug command-line flag or by signaling an existing Node.js process with SIGUSR1.
I tried doing this with:
process.kill(process.pid, 'SIGUSR1');
Which produced the error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Unknown signal: SIGUSR1
at EventEmitter.kill (node.js:366:17)
at Object.<anonymous> (c:\dev\some-module\app.js:94:17)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
What do I need to do to get the running process switched to debug mode?
Also, I would like to debug the given application with node-inspector.
I'm not quite sure if I understood your question, but...
You can probably install an app globally and have it stop in a breakpoint using npm. In package.json put:
...
"scripts": {"start": "node --debug-brk some-module.js"},
"bin" : { "some-module" : "./some-module.js" },
...
Running npm start -g some-module will break at first line.
You can then use node-inspector for debugging.
About the part with stopping from within the code, node has a build in debugger (which is quite rudimentary), but it allows this functionality.
If you include somewhere in the code:
debugger;
and run:
node debug some-module.js
it will stop there in the debugger (note: this is not the same as node-inspector, i don't know if this can be achieved with node-inspector).
Don't really understand the reason why you're doing this, but hope this helps.

Resources