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

Installer fails when no args are provided #1302

Closed
jstockdi opened this issue Nov 7, 2024 · 4 comments · Fixed by #1303
Closed

Installer fails when no args are provided #1302

jstockdi opened this issue Nov 7, 2024 · 4 comments · Fixed by #1303
Assignees
Labels
bug Something isn't working Init v0.30.1
Milestone

Comments

@jstockdi
Copy link
Contributor

jstockdi commented Nov 7, 2024

Type of Change

Bug

Summary

Trying to install 0.30.0...

jstockdi@MacBook-Pro-3 mixtape-2.0 % node -v
v18.20.3
jstockdi@MacBook-Pro-3 mixtape-2.0 % npm -v
10.9.0
jstockdi@MacBook-Pro-3 mixtape-2.0 %  npx @greenwood/init@latest

-------------------------------------------------------
Initialize a Greenwood Project ♻️
-------------------------------------------------------
Error: ENOENT: no such file or directory, mkdir '/Users/jstockdi/Development/mixtape-2.0/Users/jstockdi/.npm/_npx/eba34446a49ea7f5/node_modules/.bin/init'
    at Object.mkdirSync (node:fs:1391:3)
    at run (file:///Users/jstockdi/.npm/_npx/eba34446a49ea7f5/node_modules/@greenwood/init/src/index.js:268:12)
    at file:///Users/jstockdi/.npm/_npx/eba34446a49ea7f5/node_modules/@greenwood/init/src/index.js:323:1
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12) {
  errno: -2,
  syscall: 'mkdir',
  code: 'ENOENT',
  path: '/Users/jstockdi/Development/mixtape-2.0/Users/jstockdi/.npm/_npx/eba34446a49ea7f5/node_modules/.bin/init'
}

Details

Cannot install using the default...

$ npx @greenwood/init@latest my-app

Works though...

@thescientist13
Copy link
Member

oh no! yeah, let me give this a look ASAP!

@thescientist13
Copy link
Member

just reproduced as well

➜  Desktop mkdir test
➜  Desktop cd testtest npx @greenwood/init@latest
-------------------------------------------------------
Initialize a Greenwood Project ♻️
-------------------------------------------------------
Error: ENOENT: no such file or directory, mkdir '/Users/owenbuckley/Desktop/test/Users/owenbuckley/.npm/_npx/eba34446a49ea7f5/node_modules/.bin/init'
    at Object.mkdirSync (node:fs:1395:3)
    at run (file:///Users/owenbuckley/.npm/_npx/eba34446a49ea7f5/node_modules/@greenwood/init/src/index.js:268:12)
    at file:///Users/owenbuckley/.npm/_npx/eba34446a49ea7f5/node_modules/@greenwood/init/src/index.js:323:1
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12) {
  errno: -2,
  syscall: 'mkdir',
  code: 'ENOENT',
  path: '/Users/owenbuckley/Desktop/test/Users/owenbuckley/.npm/_npx/eba34446a49ea7f5/node_modules/.bin/init'
}

Probably something small, should be able to get a patch out soon.

@thescientist13
Copy link
Member

Ok, I was able to reproduce locally by running the installer with node directly

➜  greenwood git:(master) ✗ node ./packages/init/src/index.js
-------------------------------------------------------
Initialize a Greenwood Project ♻️
-------------------------------------------------------
[
  '/Users/owenbuckley/.nvm/versions/node/v18.20.0/bin/node',
  '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/init/src/index.js'
]
{ shouldChangeDirectory: true }
Error: ENOENT: no such file or directory, mkdir '/Users/owenbuckley/Workspace/project-evergreen/greenwood/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/init/src/index.js'
    at Object.mkdirSync (node:fs:1391:3)
    at run (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/init/src/index.js:271:12)
    at file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/init/src/index.js:326:1
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12) {
  errno: -2,
  syscall: 'mkdir',
  code: 'ENOENT',
  path: '/Users/owenbuckley/Workspace/project-evergreen/greenwood/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/init/src/index.js'
}

Without getting too in the weeds, it uncovered a bug in our script running tool in how it was handling forwarding of process.argv which threw off our tests and gave them a false positive.

Now being able to reproduce, I see where the bug is in our init script and I seem to have it working as expected, so should be able to get this patched up and pushed to npm in the next day or two. 🤞

@thescientist13 thescientist13 self-assigned this Nov 7, 2024
@thescientist13 thescientist13 changed the title Installer fails Installer fails when no args are passed Nov 7, 2024
@thescientist13 thescientist13 moved this from 🔖 Ready to 🏗 In progress in [Greenwood] Phase 9 - Standards and Conventions Nov 7, 2024
@thescientist13 thescientist13 changed the title Installer fails when no args are passed Installer fails when no args are provided Nov 7, 2024
@thescientist13
Copy link
Member

Few, this looks fixed now 🙌

test npx @greenwood/init@latest
Need to install the following packages:
@greenwood/init@0.30.1
Ok to proceed? (y) y

-------------------------------------------------------
Initialize a Greenwood Project ♻️
-------------------------------------------------------
Initializing into project directory... /Users/owenbuckley/Desktop/test
Initializing project with files...
Creating package.json...
Initializing new project complete!
Complete the follow steps to get started:
1) Install dependencies with your package manager, e.g. => npm i
2) To start developing run => npm run dev
➜  test npm i
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated gulp-header@1.8.12: Removed event-stream from gulp-header
npm warn deprecated trim@0.0.1: Use String.prototype.trim() instead
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

added 344 packages, and audited 345 packages in 8s

94 packages are looking for funding
  run `npm fund` for details

5 high severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
➜  test npm run build

> test@1.0.0 build
> greenwood build

-------------------------------------------------------
Welcome to Greenwood (v0.30.1) ♻️
-------------------------------------------------------
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
building from local sources...
Running Greenwood with the build command.
pages to generate
 /
 /404/
generated page... /404/
generated page... /
success, done generating all pages!
bundling static assets...
optimizing static pages....
copying file... src/favicon.ico
copying file... .greenwood/manifest.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Init v0.30.1
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants