neutrinojs / neutrino

Create and build modern JavaScript projects with zero initial configuration.
https://neutrinojs.org
Mozilla Public License 2.0
3.95k stars 213 forks source link

npx @neutrinojs/create-project doesn't install devDependencies #1419

Closed BillRobitskeJr closed 5 years ago

BillRobitskeJr commented 5 years ago

Bug or issue?

Please try to answer the following questions:

➜  npx @neutrinojs/create-project test-component --debug
npx: installed 343 in 20.624s
                          _          _
      _ __    ___  _   _ | |_  _ __ (_) _ __    ___
     | '_ \  / _ \| | | || __|| '__|| || '_ \  / _ \
     | | | ||  __/| |_| || |_ | |   | || | | || (_) |
     |_| |_| \___| \__,_| \__||_|   |_||_| |_| \___/

Welcome to Neutrino! 👋
To help you create your new project, I am going to ask you a few questions.

? 🤔  First up, what would you like to create? Components
? 🤔  Next, what kind of components would you like to create? React Components
? 🤔  Would you like to add a test runner to your project? Jest
? 🤔  Would you like to add linting to your project? Airbnb style rules

👌  Looks like I have all the info I need. Give me a moment while I create your project!

yarn init v0.18.1
warning The yes flag has been set. This will automatically answer yes to all questions which may have security implications.
success Saved package.json
Done in 0.05s.
   create test-component/package.json
   create test-component/.neutrinorc.js
   create test-component/src/components/HelloWorld/index.jsx
   create test-component/src/index.jsx
   create test-component/test/simple_test.js
   create test-component/.eslintrc.js

⏳  Installing devDependencies: @neutrinojs/react-components@^8.3.0, neutrino@^8.3.0, prop-types, react, react-dom, @neutrinojs/jest@^8.3.0, @neutrinojs/airbnb@^8.3.0
yarn add v0.18.1
info No lockfile found.
[1/4] Resolving packages...
warning neutrino > fluture > inspect-f@1.2.2: Package does not work as advertised and was discontinued
warning @neutrinojs/jest > eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance
only, flatted is its successor.
warning @neutrinojs/react-components > @neutrinojs/react > @neutrinojs/web > @neutrinojs/style-loader > extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
warning @neutrinojs/react-components > @neutrinojs/react > @neutrinojs/web > @neutrinojs/style-loader > css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @neutrinojs/react-components > @neutrinojs/react > @neutrinojs/web > @neutrinojs/style-loader > css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @neutrinojs/react-components > @neutrinojs/react > @neutrinojs/web > @neutrinojs/style-loader > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @neutrinojs/react-components > @neutrinojs/react > @neutrinojs/web > @neutrinojs/style-loader > css-loader > cssnano > postcss-minify-selectors > postcss-selector-parser > flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
warning @neutrinojs/react-components > @neutrinojs/react > @neutrinojs/web > @neutrinojs/minify > @neutrinojs/image-minify > imagemin-mozjpeg > mozjpeg > bin-build > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[2/4] Fetching packages...
error neutrino@8.3.0: The engine "yarn" is incompatible with this module. Expected version ">=1.2.1".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
⏳  Performing one-time lint

Hooray, I successfully created your project!

I have added a few yarn scripts to help you get started:
  • To build your project run:  yarn build
  • To start your project locally run:  yarn start
  • To execute tests run:  yarn test
  • To lint your project manually run:  yarn lint
    You can also fix some linting problems with:  yarn lint --fix

Now change your directory to the following to get started:
  cd test-component

❤️  Neutrino
BillRobitskeJr commented 5 years ago

Upgrading yarn fixed the issue; however, why is create-project using yarn if I called it using npx?

edmorley commented 5 years ago

Hi! Thank you for opening an issue. Neutrino 8 requires yarn 1.2.1 or newer, hence the error seen above. However I agree that is a bug that it's being used if create-project is run via npx. As such, this is a duplicate of #1260, which has just been fixed by #1396 (on master only at the moment). The workaround in the meantime would be to remove yarn from PATH temporarily before running create-project, or else to upgrade or uninstall yarn.

I would also recommend not using Neutrino 8, and instead trying the v9 release candidates, since they fix many bugs. (The Neutrino version still applies to create-project). See #1129 for details.