"Ooops it looks like you are trying to login to Prismic through your terminal, but something has gone wrong"

I'm using Macbook Air with NodeJS installed directly from their website.

After creating a brand new project, I followed the instructions.
After installing all the necessary files on CLI, it prompted me to open up the login page.

"Browser opened, waiting for you to login..."
It redirected me to "prismic.io" but it gave me the error message as shown in my subject title.

I tried to "prismic login" at my terminal but it says "command not found".

Kindly advise how I can resolve this issue.

Thank you.

Hey @nohwee,

This depends on how far you progressed.

Did you run npx @slicemachine/init (the command provided in the prismic.io onboarding flow)? If so, did the command run successfully? If not, try running that command again.

If you're using Slice Machine and the init command has completed successfully, you can try running npm run slicemachine in your project and then log in from the Slice Machine interface.

If you just want to log in, you could try npx prismic-cli login.

If you get an error saying that npx is not a command, make sure you have npm and npx properly installed.

I hope that helps! Let me know if you have more questions.

San

1 Like

Hello Sam,

Yes I ran "npx @slicemachine/init@latest --repository [projectname redacted] --starter sveltekit-starter-prismic-minimal" in terminal

Below is the output, there seems to be an error of some sort. Appreciate you help me take a look.

Slice Machine → Initializing

:heavy_check_mark: Starter copied

:information_source: We collect telemetry data to improve user experience.
Learn more: https://prismic.dev/slice-machine/telemetry

An error occurred with Segment {
code: 'delivery_failure',
reason: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11730:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Publisher.send (/Users/[username redacted]/.npm/_npx/b6923b01b288b666/node_modules/@segment/analytics-node/dist/cjs/plugins/segmentio/publisher.js:151:34) {
cause: AggregateError
at internalConnectMultiple (node:net:1114:18)
at afterConnectMultiple (node:net:1667:5) {
code: 'ECONNREFUSED',
[errors]: [Array]
}
},
ctx: Context {
attempts: 1,
event: {
timestamp: 2024-01-05T02:18:30.224Z,
integrations: {},
event: 'SliceMachine Init Start',
type: 'track',
properties: [Object],
context: [Object],
anonymousId: 'ba335dd2-a8be-454c-a6c2-19ea046bec1a',
messageId: 'node-next-1704421110224-8d7e2e5b-dd76-494e-b72a-fb130ff0cceb',
_metadata: [Object]
},
_id: '7e2e5bdd-7699-4ef7-aafb-130ff0ccebcd',
logger: CoreLogger { _logs: [Array] },
stats: NullStats { metrics: },
_failedDelivery: { reason: [TypeError] }
}
}
:heavy_check_mark: Detected framework SvelteKit and package manager npm
:heavy_check_mark: Began core dependencies installation with npm ... (running in background)
:heavy_check_mark: Selected repository canvastest1 (flag repository used)
:heavy_check_mark: Installed core dependencies with npm
:heavy_check_mark: Updated Slice Machine configuration and loaded adapter
⠏ Logging in to Prismic...
→ Browser opened, waiting for you to login...


If I were to run "npm run slicemachine", it gives the following output :

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/[username redacted]/package.json
npm ERR! errno -2
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/Users/[username redacted]/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in: /Users/[username redacted].npm/_logs/2024-01-05T02_24_21_078Z-debug-0.log

Hey Max,

Do you have any network configurations that might block analytics or tracking? The error mentions the @segment/analytics package, which is telemetry package. It's possible that the package is getting blocked on your network, causing the error. If that's the case, you could try using a different network.

If telemetry is indeed the problem, I would recommend creating a project manually (following the instructions here) and include a declaration to disable telemetry (as described here).

Let me know if that helps or if the error persists :slight_smile:

Sam

Hello Sam.

I managed to resolve the issue, thanks to your advice.
I'm typing the below for my own reference as well as for anyone who encounters similar issues.

  1. Creating a prismicrc dot file at my home directory helps. I've manually excluded installing the telemetry.

  2. Using Chrome instead of Firefox helps with the initial login, after the CLI installation is completed in Step 1 of the "QuickStart Guide". I'm not sure if it has to do with pop-blocker in Firefox or if its simply thata Prismic works better out of the box with a vanilla install of Chrome.

Thank you Sam.

1 Like

Thanks for detailing your solution, Max!