msw init cli throws error "Unexpected token '?'"
See original GitHub issueDescribe the bug
When I execute command npx msw init public/ --save
I get the following error: Unexpected token '?'
.
Environment
msw: 0.35.0
nodejs: 12.18.2
npm: 6.14.5
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
init - Cli - Mock Service Worker Docs
init. Places the Service Worker file into a given public directory of your application. Usage. 1npx msw init <PUBLIC_DIR> [options].
Read more >Mobile Center CLI, "SyntaxError: Unexpected token" When ...
This error appears because you have an earlier version of Node installed on your machine. The Mobile Center CLI, mobile-center , requires the...
Read more >How to set up a Front-End project with Vite, React, and ...
Output of running the ESLint init command. The above commands will install ESLint on the project and a configuration file .eslintrc.json as ...
Read more >codegen.ts file - GraphQL Code Generator
GraphQL Code Generator relies on a configuration file named codegen.ts to manage all possible options, input, and output document types. The CLI ......
Read more >jest uuid unexpected token - You.com | The Search Engine You ...
JEST - SyntaxError: Unexpected token 'export' with uuid library ... doesn't get rid of the error, and I can't downgrade to Node v12...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, I think I’ve found the root cause.
inquirer@8.1.3
introduced a bug in therawlist
module that resulted in the “Unexpected token ?” exception for any consumer (which MSW CLI is). You can see inquirer@8.1.4 release notes that mention the fix for this issue.SInce
inquirer
is installed per semver, users that installed MSW in the window when 8.1.4 was the latestinquirer
version got this issue. This issue won’t be reproducible in any new installations, as the issue is fixed ininquirer
.I suggest you re-install MSW. This will propagate the latest
inquirer
, which is 8.1.5. You can verify that vianpm ls inquirer
after the installation (you’ll see it under themsw
package).