Skip to content
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

Command failed with exit code 1 (EPERM): npx install-peerdeps --yarn next-sanity@9 #7027

Open
lhoucinecherif opened this issue Jun 26, 2024 · 0 comments
Assignees

Comments

@lhoucinecherif
Copy link

lhoucinecherif commented Jun 26, 2024

Describe the bug

I'm encountering an issue while trying to initialize Sanity for a Next.js project. The install-peerdeps command fails with a permission error despite multiple attempts with different approaches. Here are the details:

To Reproduce

Steps to reproduce the behavior:

1.Install a next boilerplate
git clone https://github.com/next-enterprise.git
cd next-enterprise
yarn install --frozen-lockfile

  1. Install sanity over the next project
    npx sanity@latest init --env --create-project "Next.js Live Preview" --dataset production

  2. Answering CLI questions like this :

  • Would you like to add configuration files for a Sanity project in this Next.js folder? Yes
  • Do you want to use TypeScript? Yes
  • Would you like an embedded Sanity Studio? Yes
  • What route do you want to use for the Studio? /studio
  • Select project template to use Clean project with no predefined schema types
  • Would you like to add the project ID and dataset to your .env file? Yes

Expected behavior

The command should init & install all necessary peer dependencies for sanity inside the existing nextjs project

Which versions of Sanity are you using?

sanity: command not found

What operating system are you using?

Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

Which versions of Node.js / npm are you running?

Run npm -v && node -v in the terminal and copy-paste the result here.

npm 10.8.1
node v20.15.0

Additional context

This is the last lines of the console output :


install-peerdeps v3.0.3
Installing peerdeps for next-sanity@9.
yarn add [email protected] @sanity/client@^6.20.1 @sanity/icons@^3.0.0 @sanity/types@^3.37.1 @sanity/ui@^2.0.11 next@^15.0.0 react@^19.0.0 sanity@^3.37.1 styled-components@^6.1

ERR undefined

Error: Command failed with exit code 1 (EPERM): npx install-peerdeps --yarn next-sanity@9
    at makeError$1 (~/.npm/_npx/7c099b67f9967cde/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:17897:32)
    at ~/.npm/_npx/7c099b67f9967cde/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:18238:29
    at async initSanity (~/.npm/_npx/7c099b67f9967cde/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:44389:110)

@jordanl17 jordanl17 self-assigned this Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants