halfzebra / create-elm-app

🍃 Create Elm apps with zero configuration
MIT License
1.69k stars 147 forks source link

create-elm-app error #613

Closed qknight closed 1 year ago

qknight commented 1 year ago

Is this a bug report?

yes

Environment

  1. node -v: v11.13.0

  2. npm -v: 6.9.0

  3. npm ls create-elm-app -g: create-elm-app@5.22.0

Then, specify:

  1. Operating system: windows 10
  2. Browser and version (if relevant):

firefox, but not relevant

Steps to Reproduce

Expected Behavior

  1. create-elm-app my-dashboard
  2. elm-app start

then the app compile start and firefox should be able to see the webpage

Actual Behavior

C:\Program Files (x86)\Nodist\bin\node_modules\create-elm-app\node_modules\fraction.js\fraction.js:363
export default function Fraction(a, b) {
^^^^^^

SyntaxError: Unexpected token export
    at Module._compile (internal/modules/cjs/loader.js:749:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
    at Module.load (internal/modules/cjs/loader.js:672:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
    at Function.Module._load (internal/modules/cjs/loader.js:604:3)
    at Module.require (internal/modules/cjs/loader.js:711:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (C:\Program Files (x86)\Nodist\bin\node_modules\create-elm-app\node_modules\autoprefixer\lib\resolution.js:1:16)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
qknight commented 1 year ago

I did now a

choco uninstall nodist

And installed node via nvm-windows.

PS C:\Windows\System32> node -v
v20.5.1
PS C:\Windows\System32> npm -v
9.8.0

And now I see:

PS C:\Users\qknight\Desktop\Projects\my-dashboard-ng2> elm-app start
(node:20444) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
i 「wds」: Project is running at http://172.19.64.1/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\qknight\Desktop\Projects\my-dashboard-ng2\public
i 「wds」: 404s will fallback to /index.html
Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\scripts\start.js:11
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\NormalModule.js:417:16)
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\NormalModule.js:452:10
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\webpack\lib\NormalModule.js:323:13
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\qknight\AppData\Roaming\nvm\v20.5.1\node_modules\create-elm-app\node_modules\babel-loader\lib\index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v20.5.1
qknight commented 1 year ago

I've installed node 18 now but in the end this command made it work:

# for Windows PowerShell
$env:NODE_OPTIONS="--openssl-legacy-provider"

https://www.datainfinities.com/49/error-0308010C-digital-envelope-routines-unsupported