Installing mern-cli with Yarn results in mern-init(1) does not exist, try --help #21
Open
Description
When installing mern-cli
via Yarn, the package successfully installs
yet am unable to run any of the CLI commands.
The same issue has been found with the vue-cli
package and documented in the following issues:
vuejs/vue-cli#193 and vuejs/vue-cli#205
The issue was resolved in the following respective PR: vuejs/vue-cli#206
I am accompanying this issue with a proposed PR (#22) that resolves the issue similarly to the the vue-cli
solution and would like your feedback on whether this would be an appropriate solution for mern-cli
.
Below is a comparison of installing the package via Yarn
and NPM
followed by my environment details.
Yarn install process:
___________________________________________________
~/Sites 9:38 AM
=> yarn global add mern-cli
yarn global v0.18.1
warning No license field
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
success Installed mern-cli@3.0.1 with binaries:
- mern
- merng
warning No license field
✨ Done in 25.01s.
___________________________________________________
~/Sites 9:38 AM
=> mern init myApp
mern-init(1) does not exist, try --help
___________________________________________________
~/Sites 9:39 AM
=> mern list
mern-list(1) does not exist, try --help
___________________________________________________
~/Sites 9:39 AM
=> mern search starter
mern-search(1) does not exist, try --help
___________________________________________________
~/Sites 9:39 AM
=> mern info
mern-info(1) does not exist, try --help
___________________________________________________
~/Sites 9:40 AM
=> mern --help
Usage: mern [options] [command]
Commands:
init [name] Initialize a MERN project.
list List MERN variants
search [term] Search for MERN variant
info [term] View details of a MERN variant
help [cmd] display help for [cmd]
Initialize a MERN powered project
Options:
-h, --help output usage information
-V, --version output the version number
-v, --version check version
NPM install attempt:
___________________________________________________
~/Sites 10:43 AM
=> npm install -g mern-cli
> mern-cli@3.0.1 prepublish /Users/patrick/Sites/mern-cli
> npm run compile
> mern-cli@3.0.1 compile /Users/patrick/Sites/mern-cli
> babel --presets es2015,stage-0 -d lib/ src/
src/commands/generate.js -> lib/commands/generate.js
src/commands/main-info.js -> lib/commands/main-info.js
src/commands/main-init.js -> lib/commands/main-init.js
src/commands/main-list.js -> lib/commands/main-list.js
src/commands/main-search.js -> lib/commands/main-search.js
src/commands/main.js -> lib/commands/main.js
src/tasks/generate.js -> lib/tasks/generate.js
src/tasks/getMernConfig.js -> lib/tasks/getMernConfig.js
src/tasks/readAndRenderTemplate.js -> lib/tasks/readAndRenderTemplate.js
src/tasks/renderTargetPath.js -> lib/tasks/renderTargetPath.js
src/util/ejsHelpers.js -> lib/util/ejsHelpers.js
src/util/fileExists.js -> lib/util/fileExists.js
src/util/ui.js -> lib/util/ui.js
/Users/patrick/.nvm/versions/node/v6.9.1/bin/mern-init -> /Users/patrick/.nvm/versions/node/v6.9.1/lib/node_modules/mern-cli/bin/mern-init.js
/Users/patrick/.nvm/versions/node/v6.9.1/bin/mern-list -> /Users/patrick/.nvm/versions/node/v6.9.1/lib/node_modules/mern-cli/bin/mern-list.js
/Users/patrick/.nvm/versions/node/v6.9.1/bin/mern-info -> /Users/patrick/.nvm/versions/node/v6.9.1/lib/node_modules/mern-cli/bin/mern-info.js
/Users/patrick/.nvm/versions/node/v6.9.1/bin/mern-search -> /Users/patrick/.nvm/versions/node/v6.9.1/lib/node_modules/mern-cli/bin/mern-search.js
/Users/patrick/.nvm/versions/node/v6.9.1/bin/merng -> /Users/patrick/.nvm/versions/node/v6.9.1/lib/node_modules/mern-cli/bin/merng.js
/Users/patrick/.nvm/versions/node/v6.9.1/bin/mern -> /Users/patrick/.nvm/versions/node/v6.9.1/lib/node_modules/mern-cli/bin/mern.js
/Users/patrick/.nvm/versions/node/v6.9.1/lib
└─┬ mern-cli@3.0.1
├─┬ chalk@1.1.3
│ ├── ansi-styles@2.2.1
│ ├── escape-string-regexp@1.0.5
│ ├─┬ has-ansi@2.0.0
│ │ └── ansi-regex@2.0.0
│ ├── strip-ansi@3.0.1
│ └── supports-color@2.0.0
├─┬ cli-table@0.3.1
│ └── colors@1.0.3
├─┬ commander@2.9.0
│ └── graceful-readlink@1.0.1
├── ejs@2.5.5
├── elegant-spinner@1.0.1
├─┬ log-update@1.0.2
│ ├── ansi-escapes@1.4.0
│ └─┬ cli-cursor@1.0.2
│ └─┬ restore-cursor@1.0.1
│ ├── exit-hook@1.1.1
│ └── onetime@1.1.0
├── shelljs@0.6.1
└─┬ writefile@0.2.8
├─┬ lift-result@0.1.5
│ └─┬ result@1.0.3
│ └─┬ result-core@1.2.1
│ └── next-tick@0.0.2 (git://github.com/timoxley/next-tick.git#6f25f8c2d25697dead7e49e978ae4c31703f7490)
├─┬ mkdirp@0.5.1
│ └── minimist@0.0.8
└── result-type@1.0.0
___________________________________________________
~/Sites 10:43 AM
=> mern init myApp
Initialized empty Git repository in /Users/patrick/Sites/myApp/.git/
Fetching the boilerplate...⠋
From https://github.com/Hashnode/mern-starter
Completed.....You are good to go!
___________________________________________________
~/Sites 10:44 AM
=> mern-list
MERN Variants
-------------
┌──────────────┬──────────────────────┬──────────┐
│ Name │ Description │ Author │
├──────────────┼──────────────────────┼──────────┤
│ mern-starter │ Default Mern Starter │ Hashnode │
└──────────────┴──────────────────────┴──────────┘
For more info, execute "mern info <variant_name>"
___________________________________________________
~/Sites 10:45 AM
=> mern search starter
Search results for starter
-------------
┌──────────────┬──────────────────────┬──────────┐
│ Name │ Description │ Author │
├──────────────┼──────────────────────┼──────────┤
│ mern-starter │ Default Mern Starter │ Hashnode │
└──────────────┴──────────────────────┴──────────┘
For more info, execute "mern info <variant_name>"
___________________________________________________
~/Sites 10:45 AM
=> mern info
Usage: mern-info [options]
Options:
-h, --help output usage information
___________________________________________________
~/Sites 10:45 AM
=> mern --help
Usage: mern [options] [command]
Commands:
init [name] Initialize a MERN project.
list List MERN variants
search [term] Search for MERN variant
info [term] View details of a MERN variant
help [cmd] display help for [cmd]
Initialize a MERN powered project
Options:
-h, --help output usage information
-V, --version output the version number
-v, --version check version
Environment Details:
Node version: v6.9.1
Yarn version: v0.18.1
mern-cli version: v3.0
OS: macOS Sierra / 10.12.2