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

npx commands showing error for not found node modules paths #505

Closed
1 of 5 tasks
thescientist13 opened this issue Apr 4, 2021 · 1 comment · Fixed by #506 or #511
Closed
1 of 5 tasks

npx commands showing error for not found node modules paths #505

thescientist13 opened this issue Apr 4, 2021 · 1 comment · Fixed by #506 or #511
Assignees
Labels
bug Something isn't working CLI P0 Critical issue that should get addressed ASAP v0.10.1 website Tasks related to the projects website / documentation
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Apr 4, 2021

Type of Change

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

Summary

When running the npx commands for using Greenwood, there are some errors for files not found in node_modules,

ex.

% npx @greenwood/cli serve
Downloading Chromium r818858 - 132.4 Mb [====================] 100% 0.0s
-------------------------------------------------------
Welcome to Greenwood ♻️
-------------------------------------------------------
Running Greenwood with the serve command.
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
Started local development server at localhost:1984
Serializing pages at http://127.0.0.1:1984
pages to generate
 src/pages/index.md
serializing page... /

  Error: ENOENT: no such file or directory, open '/Users/owenbuckley/Workspace/scratch/node_modules/es-module-shims/dist/es-module-shims.js'


  Error: ENOENT: no such file or directory, open '/Users/owenbuckley/Workspace/scratch/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js'

Serializing complete for page /.
done serializing all pages
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
copying graph.json...
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
Started production test server at localhost:8080

  Error: ENOENT: no such file or directory, open '/Users/owenbuckley/Workspace/scratch/node_modules/es-module-shims/dist/es-module-shims.js'


  Error: ENOENT: no such file or directory, open '/Users/owenbuckley/Workspace/scratch/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js'

Details

This is likely due to the fact that certain dependencies are assumed to be in the user's current directory where a node_modules directory would be. When running with npx then this wouldn't exist, so how to resolve these???

Screen Shot 2021-04-03 at 6 46 06 PM

@thescientist13 thescientist13 added bug Something isn't working P0 Critical issue that should get addressed ASAP CLI question Further information is requested labels Apr 4, 2021
@thescientist13 thescientist13 self-assigned this Apr 4, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Apr 4, 2021
@thescientist13 thescientist13 added the website Tasks related to the projects website / documentation label Apr 4, 2021
@thescientist13 thescientist13 linked a pull request Apr 4, 2021 that will close this issue
@thescientist13 thescientist13 added v0.10.1 and removed question Further information is requested labels Apr 16, 2021
@thescientist13
Copy link
Member Author

Nice, it works now with no error from us.

% mkdir -p src/pages
owenbuckley@Owens-MBP-2 npx-test % echo "## hello world" > src/pages/index.md
owenbuckley@Owens-MBP-2 npx-test % npx @greenwood/cli serve
Downloading Chromium r818858 - 132.4 Mb [====================] 100% 0.0s
-------------------------------------------------------
Welcome to Greenwood ♻️
-------------------------------------------------------
Running Greenwood with the serve command.
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
Started local development server at localhost:1984
Serializing pages at http://127.0.0.1:1984
pages to generate
 src/pages/index.md
serializing page... /
Serializing complete for page /.
done serializing all pages
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
copying graph.json...
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
Started production test server at localhost:8080

Though of course browsers like Safari and Chrome might still expect certain files related to PWA like assets when you load a page.

Error: ENOENT: no such file or directory, open '/Users/owenbuckley/Desktop/npx-test/public/favicon.ico'

Perhaps we can find a way to provide a default favicon.ico in the meantime? I can add that as a requirement to #194.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI P0 Critical issue that should get addressed ASAP v0.10.1 website Tasks related to the projects website / documentation
Projects
None yet
1 participant