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

pre-commit fails on "Lint website" npm ERR! SyntaxError: ...\data\rules.json: Unterminated string in JSON at position 71629 #280

Closed
andrewm4894 opened this issue Jan 2, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@andrewm4894
Copy link
Collaborator

Trying to run pre-commit run --all-files and getting this error. On windows using a powershell terminal from vscode.

Making issue in case anyone else hits it.

Wondering if some node version stuff maybe.

image

PS C:\Users\andre\Documents\repos\Open-Assistant> pre-commit run --all-files
trim trailing whitespace.................................................Passed
check python ast.........................................................Passed
check yaml...............................................................Passed
check json...............................................................Passed
check for case conflicts.................................................Passed
detect private key.......................................................Passed
fix python encoding pragma...............................................Passed
forbid submodules....................................(no files to check)Skipped
mixed line ending........................................................Passed
fix requirements.txt.....................................................Passed
check that executables have shebangs.....................................Passed
check that scripts with shebangs are executable..........................Passed
check BOM - deprecated: use fix-byte-order-marker........................Passed
check for broken symlinks............................(no files to check)Skipped
check for merge conflicts................................................Passed
check for added large files..............................................Passed
fix end of files.........................................................Passed
black....................................................................Passed
flake8...................................................................Passed
isort....................................................................Passed
prettier.................................................................Passed
Lint website.............................................................Failed
- hook id: next-lint-website
- exit code: 1

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-inspector@5.1.1
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"18.2.0" from the root project
npm WARN   133 more (@chakra-ui/accordion, @chakra-ui/alert, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.4 || ^17.0.0" from react-inspector@5.1.1
npm WARN node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN   react-inspector@"^5.1.0" from @storybook/addon-actions@6.5.15
npm WARN   node_modules/@storybook/addon-actions
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.8.4 || ^17.0.0" from react-inspector@5.1.1
npm WARN   node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN     react-inspector@"^5.1.0" from @storybook/addon-actions@6.5.15
npm WARN     node_modules/@storybook/addon-actions
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @mdx-js/react@1.6.22
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"18.2.0" from the root project
npm WARN   133 more (@chakra-ui/accordion, @chakra-ui/alert, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm WARN node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
npm WARN   @mdx-js/react@"^1.6.22" from @storybook/addon-docs@6.5.15
npm WARN   node_modules/@storybook/addon-docs
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm WARN   node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
npm WARN     @mdx-js/react@"^1.6.22" from @storybook/addon-docs@6.5.15
npm WARN     node_modules/@storybook/addon-docs
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-element-to-jsx-string@14.3.4
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"18.2.0" from the root project
npm WARN   133 more (@chakra-ui/accordion, @chakra-ui/alert, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4
npm WARN node_modules/@storybook/react/node_modules/react-element-to-jsx-string
npm WARN   react-element-to-jsx-string@"^14.3.4" from @storybook/react@6.5.15
npm WARN   node_modules/@storybook/react
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4
npm WARN   node_modules/@storybook/react/node_modules/react-element-to-jsx-string
npm WARN     react-element-to-jsx-string@"^14.3.4" from @storybook/react@6.5.15
npm WARN     node_modules/@storybook/react
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-element-to-jsx-string@14.3.4
npm WARN Found: react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN   react-dom@"18.2.0" from the root project
npm WARN   41 more (@chakra-ui/modal, @chakra-ui/portal, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4
npm WARN node_modules/@storybook/react/node_modules/react-element-to-jsx-string
npm WARN   react-element-to-jsx-string@"^14.3.4" from @storybook/react@6.5.15
npm WARN   node_modules/@storybook/react
npm WARN
npm WARN Conflicting peer dependency: react-dom@17.0.2
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4        
npm WARN   node_modules/@storybook/react/node_modules/react-element-to-jsx-string
npm WARN     react-element-to-jsx-string@"^14.3.4" from @storybook/react@6.5.15
npm WARN     node_modules/@storybook/react
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'next-auth@4.18.7',
npm WARN EBADENGINE   required: { node: '^12.19.0 || ^14.15.0 || ^16.13.0 || ^18.12.0' },
npm WARN EBADENGINE   current: { node: 'v19.3.0', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\engines', 
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\@prisma\engines'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\engines'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\client',  
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\@prisma\client'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\client'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\client',  
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\@prisma\client'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\client'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\engines', 
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\@prisma\engines'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\@prisma\\engines'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\next',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\next\dist\compiled'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\next\\dist\\compiled'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\sharp',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\sharp\vendor\8.13.3\win32-x64'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\andre\\Documents\\repos\\Open-Assistant\\website\\node_modules\\sharp\\vendor\\8.13.3\\win32-x64'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\cypress
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node index.js --exec install
npm ERR! node: internal/modules/cjs/loader:1289
npm ERR!     throw err;
npm ERR!     ^
npm ERR!
npm ERR! SyntaxError: C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\psl\data\rules.json: Unterminated string in JSON at position 71629
npm ERR!     at parse (<anonymous>)
npm ERR!     at Module._extensions..json (node:internal/modules/cjs/loader:1286:39)
npm ERR!     at Module.load (node: internal/modules/cjs/loader:1081:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:922:12)
npm ERR!     at Module.require (node: internal/modules/cjs/loader:1105:19)
npm ERR!     at require (node: internal/modules/cjs/helpers:103:18)
npm ERR!     at Object.<anonymous> (C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\psl\index.js:14:19)
npm ERR!     at Module._compile (node: internal/modules/cjs/loader:1218:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1081:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:922:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1105:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:103:18)
npm ERR!     at Object.<anonymous> (C:\Users\andre\Documents\repos\Open-Assistant\website\node_modules\tough-cookie\lib\pubsuffix-psl.js:32:11)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1218:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
npm ERR!
npm ERR! Node.js v19.3.0

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\andre\AppData\Local\npm-cache\_logs\2023-01-02T15_42_28_697Z-debug-0.log
@yk
Copy link
Collaborator

yk commented Jan 2, 2023

does anyone else get this problem? is it a windows problem?

@yk yk added the bug Something isn't working label Jan 2, 2023
@audreyfeldroy
Copy link
Contributor

Tried pre-commit run --all-files on macOS Ventura 13.1 just now with the latest and didn't get this failure.

@Vechtomov
Copy link
Collaborator

I'm not sure, but it seems to be caused by locking files or folders in Windows.
The common cause of locking is some process that is using this file/folder, such as anti malware software, open terminal, etc.
Here are the ways how people solved this issue:
https://github.com/npm/npm/issues/13461
https://stackoverflow.com/questions/55212864/error-ebusy-resource-busy-or-locked-rmdir

@andrewm4894
Copy link
Collaborator Author

andrewm4894 commented Jan 6, 2023

I get it on windows. But usually since it runs last it fixes the other checks first and has not blocked me yet.

Has been ok recently though. Will try see if I can figure out how to make it reproducible.

@AbdBarho
Copy link
Collaborator

Is this still an issue? if not, can we close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

5 participants