-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package import not working #2652
Comments
Seems like it is complaining about the Are you sure you are using node 18.16.0? Can you please |
I'm sure about the version, here's the full logs: /home/Project/node_modules/@redis/client/dist/lib/cluster/cluster-slots.js:89
return node.client ?? __classPrivateFieldGet(this, _RedisClusterSlots_instances, "m", _RedisClusterSlots_createNodeClient).call(this, node);
^
SyntaxError: Invalid or unexpected token
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
Node.js v18.16.0
error Command failed.
Exit code: 1
Command: /home/Project/.nvm/versions/node/v18.16.0/bin/node
Arguments: -r esm script.js
Directory: /home/Project/
Output:
info Visit https://yarnpkg.com/en/docs/cli/node for documentation about this command. |
I just did
import { createClient } from 'redis';
console.log(`Node Version: ${process.version}`);
const client = await createClient()
.on('error', err => console.log('Redis Client Error', err))
.connect();
console.log('Connected');
await client.disconnect();
console.log('Disconnected'); and this is what I get in the logs:
Am I doing anything differently? |
I'm using this cmd: node -r esm script.js Which one did you use? |
edit: why are you using |
I'm importing the configuration from another |
Description
I'm trying to execute a simple script but package import is not working, I'm getting an error
here's the code used
I'm using
Node.js v18.16.0
Any help would be appreciated here.
Thanks
Node.js Version
Node.js v18.16.0
Redis Server Version
redis_version:6.2.13
Node Redis Version
redis@4.6.10
Platform
Linux
Logs
The text was updated successfully, but these errors were encountered: