Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run cookiecutter to generate dash-component-boilerplate #108

Open
jv1522 opened this issue Sep 25, 2020 · 8 comments
Open

Unable to run cookiecutter to generate dash-component-boilerplate #108

jv1522 opened this issue Sep 25, 2020 · 8 comments

Comments

@jv1522
Copy link

jv1522 commented Sep 25, 2020

Here is the error I get when extracting the dash component boilerplate:

C:\Users\jvanga\git>cookiecutter https://github.com/plotly/dash-component-boilerplate.git
You've downloaded C:\Users\jvanga.cookiecutters\dash-component-boilerplate before. Is it okay to delete and re-download it? [yes]: yes
project_name [my dash component]: my-dash-component
project_shortname [my_dash_component]:
component_name [MyDashComponent]:
jl_prefix []:
r_prefix []:
author_name [Enter your first and last name (For package.json)]: Jnaneswar Vanga
author_email [Enter your email (For package.json)]: jvanga@ford.com
github_org []:
description [Project Description]: dash boilerplate to create custom components
Select license:
1 - MIT License
2 - BSD License
3 - ISC License
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]: 1
publish_on_npm [True]: False
install_dependencies [True]:
The system cannot find the path specified.
ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

@rpkyle
Copy link

rpkyle commented Dec 1, 2020

I'm sorry you encountered this error @jv1522; I was able to use cookiecutter locally, though I'm not currently using Windows on my workstation. Could you share the output of cookiecutter --version so we have a little more information?

Are you using git bash? I see a similar error was reported by another Windows user of cookiecutter here: cookiecutter/cookiecutter#1394.

@xhluca
Copy link

xhluca commented Jan 25, 2021

I tried running this with:

  • cookiecutter: 1.7.2
  • npm: 6.14.10
  • node: v14.15.4
  • python: 3.9.1
  • windows 10

I ran the cookiecutter:


C:\Users\xhlu\dev>cookiecutter https://github.com/plotly/dash-component-boilerplate.git

And didn't notice this problem. Here's the output I got:

You've downloaded C:\Users\xhlu\.cookiecutters\dash-component-boilerplate before. Is it okay to delete and re-download it? [yes]:
project_name [my dash component]:
project_shortname [my_dash_component]:
component_name [MyDashComponent]:
jl_prefix []:
r_prefix []:
author_name [Enter your first and last name (For package.json)]: Xing han
author_email [Enter your email (For package.json)]: xinghan@gmail.com
github_org []:
description [Project Description]:
Select license:
1 - MIT License
2 - BSD License
3 - ISC License
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]:
publish_on_npm [True]:
install_dependencies [True]:
Executing: C:\Users\xhlu\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -m venv venv


Installing dependencies

Executing: venv\Scripts\python -m pip install -r requirements.txt
Collecting dash[dev]>=1.15.0
  Using cached dash-1.19.0.tar.gz (75 kB)
...
Collecting pyreadline; sys_platform == "win32"
  Using cached pyreadline-2.1.zip (109 kB)
Using legacy 'setup.py install' for dash, since package 'wheel' is not installed.
...
Installing collected packages: MarkupSafe, Jinja2, Werkzeug, click, itsdangerous, Flask, brotli, flask-compress, six, retrying, plotly, dash-renderer, dash-core-components, dash-html-components, dash-table, future, dash-flow-example, dash-dangerously-set-inner-html, mccabe, pyflakes, pycodestyle, flake8, PyYAML, termcolor, fire, pyreadline, humanfriendly, coloredlogs, flask-talisman, mock, attrs, typed-ast, toml, appdirs, pathspec, regex, black, colorama, lazy-object-proxy, wrapt, astroid, isort, pylint, dash
    Running setup.py install for MarkupSafe ... done
    ...
    Running setup.py install for dash ... done
Successfully installed Flask-1.1.2 Jinja2-2.11.2 MarkupSafe-1.1.1 PyYAML-5.3.1 Werkzeug-1.0.1 appdirs-1.4.4 astroid-2.4.2 attrs-20.3.0 black-19.10b0 brotli-1.0.9 click-7.1.2 colorama-0.4.4 coloredlogs-15.0 dash-1.19.0 dash-core-components-1.15.0 dash-dangerously-set-inner-html-0.0.2 dash-flow-example-0.0.5 dash-html-components-1.1.2 dash-renderer-1.9.0 dash-table-4.11.2 fire-0.3.1 flake8-3.8.4 flask-compress-1.8.0 flask-talisman-0.7.0 future-0.18.2 humanfriendly-9.1 isort-5.7.0 itsdangerous-1.1.0 lazy-object-proxy-1.4.3 mccabe-0.6.1 mock-4.0.3 pathspec-0.8.1 plotly-4.14.3 pycodestyle-2.6.0 pyflakes-2.2.0 pylint-2.6.0 pyreadline-2.1 regex-2020.11.13 retrying-1.3.3 six-1.15.0 termcolor-1.1.0 toml-0.10.2 typed-ast-1.4.2 wrapt-1.12.1
WARNING: You are using pip version 20.2.3; however, version 21.0 is available.
You should consider upgrading via the 'C:\Users\xhlu\dev\my_dash_component\venv\Scripts\python.exe -m pip install --upgrade pip' command.
Executing: npm install --ignore-scripts
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
...
npm WARN my_dash_component@0.0.1 No repository field.

added 1364 packages from 1173 contributors and audited 1367 packages in 33.738s

55 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Building initial bundles...
Executing: npm run build:js

> my_dash_component@0.0.1 build:js C:\Users\xhlu\dev\my_dash_component
> webpack --mode production

Hash: d9dbad6cc586fc09249e
Version: webpack 4.36.1
Time: 1054ms
Built at: 01/25/2021 3:35:14 PM
                       Asset      Size  Chunks             Chunk Names
    my_dash_component.min.js  3.18 KiB       0  [emitted]  main
my_dash_component.min.js.map  7.61 KiB       0  [emitted]  main
Entrypoint main = my_dash_component.min.js my_dash_component.min.js.map
[0] external "PropTypes" 42 bytes {0} [built]
[1] external "React" 42 bytes {0} [built]
[2] ./src/lib/index.js + 1 modules 5.15 KiB {0} [built]
    | ./src/lib/index.js 143 bytes [built]
    |     + 1 hidden module
Executing: venv\Scripts\python -m dash.development.component_generator ./src/lib/components my_dash_component -p package-info.json --jl-prefix '' --r-prefix ''
Generated MyDashComponent.py
Generated ''MyDashComponent.R
Generated ''_mydashcomponent.jl
Warning: a URL for bug reports was not provided. Empty string inserted.
Warning: a homepage URL was not provided. Empty string inserted.
Generated src\MyDashComponent.jl
Generated Project.toml

my_dash_component ready!

@GusFurtado
Copy link

I'm facing the same error.

  • npm: 8.3.0
  • node: 17.3.0
  • Cookiecutter: 1.7.3
  • Python: 3.7.7 and 3.9.6 (I tried on both of them)
  • Windows 10
Executing: npm install --ignore-scripts
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

added 966 packages, and audited 967 packages in 2m

70 packages are looking for funding
  run `npm fund` for details

16 vulnerabilities (12 moderate, 4 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
Building initial bundles...
Executing: npm run build:js

> my_dash_component@0.0.1 build:js
> webpack --mode production

node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\webpack\lib\NormalModule.js:401:16)
    at handleParseError (C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\webpack\lib\NormalModule.js:452:10)
    at C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\webpack\lib\NormalModule.js:484:5
    at C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\webpack\lib\NormalModule.js:343:12
    at C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at context.callback (C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\gusta\dash-component-boilerplate\my_dash_component\node_modules\babel-loader\lib\index.js:59:71 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.3.0
post_gen_project command failed: npm run build:js
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

@Brandontam29
Copy link

I am having the same issue:
WSL 2 with ubuntu
Node 18.1.0
npm 8.8.0
python 3.10.4

project_name [my dash component]: crystal_visualizer
project_shortname [crystal_visualizer]: 
component_name [CrystalVisualizer]: 
jl_prefix []: 
r_prefix []: 
author_name [Enter your first and last name (For package.json)]: brandon
author_email [Enter your email (For package.json)]: btam@nanoacdemic.com
github_org []: 
description [Project Description]: 
Select use_async:
1 - False
2 - True
Choose from 1, 2 [1]: 
Select license:
1 - MIT License
2 - BSD License
3 - ISC License
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]: 6
publish_on_npm [True]: False
install_dependencies [True]: 



use_async
False
use_async is set to False, your component will not be lazy loaded and fragments will not be created.
Executing: virtualenv venv
created virtual environment CPython3.10.4.final.0-64 in 402ms
  creator CPython3Posix(dest=/home/brandon/nano-academic-wsl/es_app/crystal_visualizer/venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/brandon/.local/share/virtualenv)
    added seed packages: pip==22.1.2, setuptools==62.2.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator


Installing dependencies

Executing: venv/bin/python -m pip install -r requirements.txt
Collecting dash[dev]>=1.15.0
  Using cached dash-2.5.0-py3-none-any.whl (9.8 MB)
Collecting dash-table==5.0.0
  Using cached dash_table-5.0.0-py3-none-any.whl (3.9 kB)
Collecting Flask>=1.0.4
  Using cached Flask-2.1.2-py3-none-any.whl (95 kB)
Collecting dash-html-components==2.0.0
  Using cached dash_html_components-2.0.0-py3-none-any.whl (4.1 kB)
Collecting dash-core-components==2.0.0
  Using cached dash_core_components-2.0.0-py3-none-any.whl (3.8 kB)
Collecting flask-compress
  Using cached Flask_Compress-1.12-py3-none-any.whl (7.9 kB)
Collecting plotly>=5.0.0
  Downloading plotly-5.8.2-py2.py3-none-any.whl (15.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.2/15.2 MB 22.7 MB/s eta 0:00:00
Collecting fire>=0.4.0
  Using cached fire-0.4.0-py2.py3-none-any.whl
Collecting coloredlogs>=15.0.1
  Using cached coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
Collecting PyYAML>=5.4.1
  Using cached PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (682 kB)
Collecting humanfriendly>=9.1
  Using cached humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting termcolor
  Using cached termcolor-1.1.0-py3-none-any.whl
Collecting itsdangerous>=2.0
  Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting click>=8.0
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting Werkzeug>=2.0
  Using cached Werkzeug-2.1.2-py3-none-any.whl (224 kB)
Collecting Jinja2>=3.0
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting tenacity>=6.2.0
  Using cached tenacity-8.0.1-py3-none-any.whl (24 kB)
Collecting brotli
  Using cached Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.7 MB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Installing collected packages: termcolor, dash-table, dash-html-components, dash-core-components, brotli, Werkzeug, tenacity, six, PyYAML, MarkupSafe, itsdangerous, humanfriendly, click, plotly, Jinja2, fire, coloredlogs, Flask, flask-compress, dash
Successfully installed Flask-2.1.2 Jinja2-3.1.2 MarkupSafe-2.1.1 PyYAML-6.0 Werkzeug-2.1.2 brotli-1.0.9 click-8.1.3 coloredlogs-15.0.1 dash-2.5.0 dash-core-components-2.0.0 dash-html-components-2.0.0 dash-table-5.0.0 fire-0.4.0 flask-compress-1.12 humanfriendly-10.0 itsdangerous-2.1.2 plotly-5.8.2 six-1.16.0 tenacity-8.0.1 termcolor-1.1.0
Executing: npm install --ignore-scripts
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

added 971 packages, and audited 972 packages in 35s

74 packages are looking for funding
  run `npm fund` for details

4 high severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
Building initial bundles...
Executing: npm run build:js

> crystal_visualizer@0.0.1 build:js
> webpack --mode production

node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/webpack/lib/NormalModule.js:401:16)
    at handleParseError (/home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/webpack/lib/NormalModule.js:452:10)
    at /home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/webpack/lib/NormalModule.js:484:5
    at /home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/webpack/lib/NormalModule.js:343:12
    at /home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/brandon/nano-academic-wsl/es_app/crystal_visualizer/node_modules/babel-loader/lib/index.js:59:71 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.1.0
post_gen_project command failed: npm run build:js
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

@dmeinrath
Copy link

Is there an update on this issue?

The current release breaks on any system using Node > 16 because of a dependency on the version of 'webpack' used by the 'cookiecutter' script was broken by a transition in Node 17 to using OpenSSL 3 and right now it causes the template creation process to fail without a great explanation.

More importantly, anyone following the README instructions and uses the current Node LTS (18) (which the README links to) will not be able to build this

@basab-gupta
Copy link

Just chiming in to say, that I just ran into the same issue while trying to use cookiecutter to set up my project. Has anyone managed to figure it out yet?

@borisdiakur
Copy link

Here is a workaround:

export NODE_OPTIONS=--openssl-legacy-provider && cookiecutter https://github.com/plotly/dash-component-boilerplate.git

On Windows you'll have to use set NODE_OPTIONS=--openssl-legacy-provider ....

@apivan2
Copy link

apivan2 commented Apr 28, 2023

Thanks @borisdiakur

Add PowerShell:
$env:NODE_OPTIONS="--openssl-legacy-provider"; cookiecutter https://github.com/plotly/dash-component-boilerplate.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants