nuejs / create-nue

A recommended way to start a Nue project
https://nuejs.org
139 stars 30 forks source link

fix: Compatible with npx #29

Closed gucovip closed 9 months ago

gucovip commented 9 months ago

fix compatible with npx

gucovip commented 9 months ago

Temporarily use npx to overdo it. nue issue #110 npx create-nue@latest

But if npx is used now, the following error occurs.

npx create-nue@latest
Need to install the following packages:
  create-nue@0.2.1
Ok to proceed? (y)
node_modules/.bin/create-nue: line 1: import: command not found
node_modules/.bin/create-nue: line 2: import: command not found
node_modules/.bin/create-nue: line 4: import: command not found
node_modules/.bin/create-nue: line 5: import: command not found
node_modules/.bin/create-nue: line 7: syntax error near unexpected token `('
node_modules/.bin/create-nue: line 7: `async function copyTemplate(name, to) {'
tipiirai commented 9 months ago

Gotcha. Makes sense. Isn't 'use strict' unnecessary with ES6 modules?

gucovip commented 9 months ago

@tipiirai OK. I've removed the 'use strict'.

tipiirai commented 9 months ago

Hey. Added #!/usr/bin/env bun to cli.js and bun create started to work! Works on the latest version (bun create nuekit@latest. Thanks to the inspiration of this pull request. Thank you @gucovip !