Closed leoj3n closed 1 year ago
The following seems to fix the issue with CLI flags not being read correctly on my machine:
❯ npm init marko -- --template tags-api
✔ Type your project name · heyhey
✔ Project created! To get started, run:
cd heyhey
npm run dev
❯ cd heyhey
❯ cat package.json
{
"name": "heyhey",
"description": "The Marko starter app with the tags api preview enabled",
"version": "1.0.0",
"dependencies": {
"@marko/tags-api-preview": "^0",
"marko": "^5"
},
"devDependencies": {
"@marko/build": "^4",
"@marko/serve": "^4"
},
"private": true,
"scripts": {
"build": "marko-build ./src/pages",
"dev": "marko-serve ./src/pages",
"start": "NODE_ENV=production node ./build/index.js"
}
Notice the --
separator in npm init marko -- --template tags-api
I have encountered the issue on a long running heavily customized macOS dev machine as well as a mostly stock and newer macOS machine so not sure if it's just me but it seems to be an issue everywhere I've tried.
Perhaps update the suggested command across the docs and twitter post to make it more robust regardless?
EDIT: reference https://docs.npmjs.com/cli/v8/commands/npm-init#forwarding-additional-options
See #214 for PR fix
Manually running from cloned repo in
marko-js/cli/packages/create
:Works as expected.
However, when using
npm init
:...
See above it looks as though
tags-api
is being used as name of app and not take astemplate
option.Trying to add name on cli command results in array error for path argument.
Not sure if anyone can reproduce or if it is only me?