Code Monkey home page Code Monkey logo

Comments (8)

pokusew avatar pokusew commented on June 9, 2024

Hi @emond07,

thank you for posting your issue. πŸ™‚

According to the error output you posted, you are trying to run the basic example, right?

However, the examples use import/export modules syntax which is not supported in Node.js by default (you need some transpiler, e.g. Babel with appopripate plugins, or you can enable native support (with some limitations) in the newest Node.js versions).

The simplest way to run the example is with npm run example-basic or yarn example-basic. As you can see here in the package.json, it is actually an alias for node -r babel-register examples/basic.js. Requiring babel-register using -r flag, ensures the code is transpiled applying rules from project's root .babelrc.

Hope it helps.

Feel free to contact me, if you encounter any problems or need any help.


PS Don't forget to star ⭐️ my library, if you find it useful. πŸ˜ƒ Thanks.

from nfc-pcsc.

pokusew avatar pokusew commented on June 9, 2024

Hi @emond07,

any updates on this issue?
Were you able to make it work?

Please let me know so I can close the issue. Thanks. πŸ™‚

from nfc-pcsc.

pokusew avatar pokusew commented on June 9, 2024

@emond07 I am closing the issue now. Feel free to reopen it in case you are still facing the issue. πŸ˜‰

from nfc-pcsc.

emond07 avatar emond07 commented on June 9, 2024

hi,

Im having issues in running the basic.js using NPM

C:\Users\emond\Desktop\nfc\nfc-pcsc>npm run example-basic

[email protected] example-basic C:\Users\emond\Desktop\nfc\nfc-pcsc
node -r @babel/register examples/basic.js

internal/modules/cjs/loader.js:589
throw err;
^

Error: Cannot find module '@babel/register'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
at Function.Module._load (internal/modules/cjs/loader.js:513:25)
at Module.require (internal/modules/cjs/loader.js:643:17)
at Module._preloadModules (internal/modules/cjs/loader.js:828:12)
at preloadModules (internal/bootstrap/node.js:733:7)
at startup (internal/bootstrap/node.js:298:9)
at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] example-basic: node -r @babel/register examples/basic.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] example-basic script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\emond\AppData\Roaming\npm-cache_logs\2019-01-05T00_31_28_240Z-debug.log

C:\Users\emond\Desktop\nfc\nfc-pcsc>

from nfc-pcsc.

pokusew avatar pokusew commented on June 9, 2024

Hi @emond07,

it seems that you had not installed the dependencies before you ran the example.

Try to install the dependencies with npm install first and then run npm run example-basic.

For more info, see Running examples locally section of the README.

Hope it helps. πŸ™‚


PS Don't forget to star ⭐️my library, if you find it useful. πŸ˜ƒThanks.

from nfc-pcsc.

emond07 avatar emond07 commented on June 9, 2024

it now working.. thanks for the help

from nfc-pcsc.

pokusew avatar pokusew commented on June 9, 2024

@emond07 You're welcome! πŸ™‚
Enjoy using the nfc-pcsc library and don't forget to star ⭐️it, if you find it useful. πŸ˜ƒThanks.

from nfc-pcsc.

tk7589 avatar tk7589 commented on June 9, 2024

I get this error

SyntaxError: Unexpected token <
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)

from nfc-pcsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.