-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
docsify
fails under yarn pnp strict mode due to missing ansi-colors
dependency
#191
Comments
docsify
fails under pnpm / yarn strict mode due to missing ansi-colors
dependencydocsify
fails under yarn pnp strict mode due to missing ansi-colors
dependency
For anyone else dealing with this, you can work around it by using "loose" Plug'n'Play mode until there's an update. $ yarn config set pnpMode loose
➤ YN0000: Successfully set pnpMode to 'loose' You'll also need to remove the cached Plug'n'Play install file and reinstall your dependencies: $ rm .pnp.cjs
$ yarn install
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done in 0s 341ms |
Apparently there are other missing dependency declarations, too 😅 $ yarn run docsify serve -p 3006
(node:39416) [MODULE_NOT_FOUND] Error: docsify-cli tried to access ansi-colors, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:39416) [MODULE_NOT_FOUND] Error: node-fetch tried to access encoding (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
(node:39416) [MODULE_NOT_FOUND] Error: debug tried to access supports-color (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
(node:39416) [MODULE_NOT_FOUND] Error: docsify-server-renderer tried to access marked, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
(node:39416) [MODULE_NOT_FOUND] Error: docsify-server-renderer tried to access prismjs, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
(node:39416) [MODULE_NOT_FOUND] Error: docsify-server-renderer tried to access strip-indent, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
(node:39416) [MODULE_NOT_FOUND] Error: docsify-cli tried to access y18n, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
(node:39416) [MODULE_NOT_FOUND] Error: yargonaut tried to access yargs, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. Using |
Yarn (v2/3) by default operates in a strict Plug'n'Play mode which does not allow directly loading indirect dependencies.
lib/commands/init.js
directly requiresansi-colors
, but it's not listed inpackage.json
.yarn run docsify
, therefore, fails (even ifdocsify-cli
is correctly registered inpackage.json
).Adding
"ansi-colors": "^4.1.1"
todependencies
should be enough (I chose that version because it's what's already inpackage-lock.json
from an indirect dependency).The text was updated successfully, but these errors were encountered: