Open ChrisLaRocque opened 3 months ago
Were you able to find a fix for this? I have similar issues using Sanity 3.52.2
where I get Could not resolve dependency
unless I use --legacy-peer-deps
whenever I run any npm install or update commands.
I also think it is causing an issue with the pt-string
plugin.
Here is my package.json for reference if this issue gets looked into:
{
"name": "backend",
"private": true,
"version": "1.0.0",
"main": "package.json",
"license": "UNLICENSED",
"scripts": {
"dev": "sanity dev",
"start": "sanity start",
"build": "sanity build",
"deploy": "sanity deploy",
"deploy-graphql": "sanity graphql deploy"
},
"keywords": [
"sanity"
],
"dependencies": {
"@sanity/dashboard": "^3.1.4",
"@sanity/types": "^3.30.1",
"@sanity/vision": "^3.52.2",
"get-youtube-id": "^1.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"react-lite-youtube-embed": "^2.3.52",
"sanity": "^3.52.2",
"sanity-plugin-dashboard-widget-netlify": "^2.0.1",
"sanity-plugin-media": "^2.0.5",
"sanity-plugin-netlify": "^1.1.0",
"sanity-plugin-pt-string": "^0.0.5",
"styled-components": "^6.1.12"
},
"devDependencies": {
"@sanity/eslint-config-studio": "^2.0.1",
"@types/react": "^18.0.25",
"@types/styled-components": "^5.1.26",
"eslint": "^8.6.0",
"prettier": "^2.8.8",
"typescript": "^4.9.5"
},
"prettier": {
"semi": false,
"printWidth": 100,
"bracketSpacing": false,
"singleQuote": true
}
}
Describe the bug
Running
npx sanity init
in a clean NextJS app fails due to a peer deps issue with next-sanity. Runningnpm i next-sanity
after the failure works. To ReproduceSteps to reproduce the behavior:
npx create-next-app@latest
(all default options)npx sanity init
(all default options besides the 'app router' option)npm ERR! A complete log of this run can be found in: /Users/chrislarocque/.npm/_logs/2024-06-22T15_24_14_848Z-debug-0.log
Error: Command failed with exit code 1 (EPERM): npm install next-sanity@7 at makeError$1 (~/.nvm/versions/node/v18.18.2/lib/node_modules/sanity/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:18060:32) at ~/.nvm/versions/node/v18.18.2/lib/node_modules/sanity/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:18409:29 at async initSanity (~/.nvm/versions/node/v18.18.2/lib/node_modules/sanity/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:44801:24)
@sanity/cli (global) 3.47.1 (up to date) @sanity/image-url 1.0.2 (up to date) @sanity/vision 3.47.1 (up to date) sanity 3.47.1 (up to date)
9.8.1 v18.18.2