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

Error: Cannot find module 'cssnano' when running CLI commands (alpha.5) #479

Closed
1 of 5 tasks
thescientist13 opened this issue Feb 20, 2021 · 0 comments · Fixed by #480
Closed
1 of 5 tasks

Error: Cannot find module 'cssnano' when running CLI commands (alpha.5) #479

thescientist13 opened this issue Feb 20, 2021 · 0 comments · Fixed by #480
Assignees
Labels
alpha.6 bug Something isn't working CLI P0 Critical issue that should get addressed ASAP v0.10.0

Comments

@thescientist13
Copy link
Member

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Running yarn develop after upgrading the Getting Started update branch resulted in this error

npm run develop

> [email protected] develop /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started
> greenwood develop

internal/modules/cjs/loader.js:797
    throw err;
    ^

Error: Cannot find module 'cssnano'
Require stack:
- /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js
- /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/lifecycles/serve.js
- /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/commands/build.js
- /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js:8:17)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js',
    '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/lifecycles/serve.js',
    '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/commands/build.js',
    '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood-getting-started/node_modules/@greenwood/cli/src/index.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: `greenwood develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/owenbuckley/.npm/_logs/2021-02-20T16_42_06_532Z-debug.log

Details

As part of the refactoring in #473 , with some of the plugin refactoring and shifting of package.json, it looks like cssnano is only coming in via @greenwood/plugin-postcss and it should just be default with @greenwood/cli

$ yarn why cssnano
yarn why v1.12.3
[1/4] 🤔  Why do we have the module "cssnano"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "_project_#@greenwood#plugin-import-css#rollup-plugin-postcss" depends on it
   - Hoisted from "_project_#@greenwood#plugin-import-css#rollup-plugin-postcss#cssnano"
info Disk size without dependencies: "48KB"
info Disk size with unique dependencies: "1.36MB"
info Disk size with transitive dependencies: "25.89MB"
info Number of shared dependencies: 52
✨  Done in 1.01s.

Just need to explicitly add / hoist cssnano to the @greenwood/cli package.

@thescientist13 thescientist13 added bug Something isn't working P0 Critical issue that should get addressed ASAP CLI labels Feb 20, 2021
@thescientist13 thescientist13 self-assigned this Feb 20, 2021
@thescientist13 thescientist13 changed the title Error: Cannot find module 'cssnano' (alpha.5) Error: Cannot find module 'cssnano' when running CLI commands (alpha.5) Feb 20, 2021
@thescientist13 thescientist13 linked a pull request Feb 20, 2021 that will close this issue
@thescientist13 thescientist13 mentioned this issue Feb 20, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.6 bug Something isn't working CLI P0 Critical issue that should get addressed ASAP v0.10.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant