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

Uneeded npm dependency check #1772

Open
truesilver92 opened this issue Aug 23, 2019 · 1 comment

Comments

@truesilver92
Copy link

commented Aug 23, 2019

Table of Contents

  1. Description
  2. Steps to Reproduce the Problem
  3. Expected Behavior
  4. Actual Behavior
  5. Workaround
  6. Info

Description

There seems to be a requirement/dependency check for npm even when
using yarn (the default)

Steps to Reproduce the Problem

  1. Start with a clean development environment

    docker run -it gobuffalo/buffalo:development sh
    
  2. Remove the npm binary (meant to simulate the npm package not being
    installed)

    rm /usr/bin/npm
    
  3. Try to create a new project

    buffalo new purple
    

Expected Behavior

I expected buffalo to create a new project using yarn as the
javascript dependency manager. I run ArchLinux, and npm is no longer
required to be installed when installing nodejs.

Actual Behavior

Comes back with an error

ERRO[0075] Error: could not find npm executable

Workaround

Sym linking npm to yarn works

rm -rf purple
ln -s /usr/bin/yarn /usr/bin/npm
buffalo new purple

Info

From the pwd /go/src/purple I ran buffalo new purple in

# buffalo info
-> Go: Checking installation
✓ The `go` executable was found on your system at: /usr/local/go/bin/go

-> Go: Checking minimum version requirements
✓ Your version of Go, 1.12.9, meets the minimum requirements.

-> Go: Checking GOPATH
✓ You appear to be operating inside of your GOPATH.

-> Go: Checking Package Management
⚠ You do not appear to be using a package management system.

It is strongly suggested that you use one of the following package management systems:

* Go Modules (Recommended) - https://gobuffalo.io/en/docs/gomods
* Dep - https://github.com/golang/dep

For help setting up your Go environment please follow the instructions for you platform at:

https://www.gopherguides.com/courses/preparing-your-environment-for-go-development

-> Go: Checking PATH
✓ Your PATH contains /go/bin.

-> Node: Checking installation
✓ The `node` executable was found on your system at: /usr/bin/node

-> Node: Checking minimum version requirements
✓ Your version of Node, v10.16.3, meets the minimum requirements.

-> NPM: Checking installation
✘ The `npm` executable could not be found on your system.
For help setting up your NPM environment please follow the instructions for you platform at:

https://docs.npmjs.com/getting-started/configuring-your-local-environment

-> Yarn: Checking installation
✓ The `yarnpkg` executable was found on your system at: /usr/bin/yarnpkg

-> Yarn: Checking minimum version requirements
✓ Your version of Yarn, 1.17.3, meets the minimum requirements.

-> PostgreSQL: Checking installation
✘ The `postgres` executable could not be found on your system.
For help setting up your Postgres environment please follow the instructions for you platform at:

https://www.postgresql.org/download/

-> MySQL: Checking installation
✘ The `mysql` executable could not be found on your system.
For help setting up your MySQL environment please follow the instructions for you platform at:

https://www.mysql.com/downloads/

-> SQLite3: Checking installation
✓ The `sqlite3` executable was found on your system at: /usr/bin/sqlite3

-> SQLite3: Checking minimum version requirements
✓ Your version of SQLite3, 3.27.2, meets the minimum requirements.

-> Cockroach: Checking installation
✘ The `cockroach` executable could not be found on your system.
For help setting up your Cockroach environment please follow the instructions for you platform at:

https://www.cockroachlabs.com/docs/stable/

-> Buffalo: Checking installation
✓ The `buffalo` executable was found on your system at: /go/bin/buffalo

-> Buffalo: Checking minimum version requirements
✘ Invalid Semantic Version

-> Buffalo: Application Details
Pwd         /go/src
Root        /go/src
GoPath      /go
PackagePkg  src
ActionsPkg  src/actions
ModelsPkg   src/models
GriftsPkg   src/grifts
WithModules false
Name        src
Bin         bin/src
VCS         
WithPop     false
WithSQLite  false
WithDep     false
WithWebpack false
WithNodeJs  false
WithYarn    false
WithDocker  false
WithGrifts  false
AsWeb       true
AsAPI       false
InApp       false
PackageJSON {map[]}

From the partially created new project pwd /go/src/purple

-> Go: Checking installation
✓ The `go` executable was found on your system at: /usr/local/go/bin/go

-> Go: Checking minimum version requirements
✓ Your version of Go, 1.12.9, meets the minimum requirements.

-> Go: Checking GOPATH
✓ You appear to be operating inside of your GOPATH.

-> Go: Checking Package Management
⚠ You do not appear to be using a package management system.

It is strongly suggested that you use one of the following package management systems:

=* Go Modules (Recommended) - https://gobuffalo.io/en/docs/gomods=
=* Dep - https://github.com/golang/dep=

For help setting up your Go environment please follow the instructions for you platform at:

=https://www.gopherguides.com/courses/preparing-your-environment-for-go-development=

-> Go: Checking PATH
✓ Your PATH contains /go/bin.

-> Node: Checking installation
✓ The `node` executable was found on your system at: /usr/bin/node

-> Node: Checking minimum version requirements
✓ Your version of Node, v10.16.3, meets the minimum requirements.

-> NPM: Checking installation
✘ The `npm` executable could not be found on your system.
For help setting up your NPM environment please follow the instructions for you platform at:

=https://docs.npmjs.com/getting-started/configuring-your-local-environment=

-> Yarn: Checking installation
✓ The `yarnpkg` executable was found on your system at: /usr/bin/yarnpkg

-> Yarn: Checking minimum version requirements
✓ Your version of Yarn, 1.17.3, meets the minimum requirements.

-> PostgreSQL: Checking installation
✘ The `postgres` executable could not be found on your system.
For help setting up your Postgres environment please follow the instructions for you platform at:

=https://www.postgresql.org/download/=

-> MySQL: Checking installation
✘ The `mysql` executable could not be found on your system.
For help setting up your MySQL environment please follow the instructions for you platform at:

=https://www.mysql.com/downloads/=

-> SQLite3: Checking installation
✓ The `sqlite3` executable was found on your system at: /usr/bin/sqlite3

-> SQLite3: Checking minimum version requirements
✓ Your version of SQLite3, 3.27.2, meets the minimum requirements.

-> Cockroach: Checking installation
✘ The `cockroach` executable could not be found on your system.
For help setting up your Cockroach environment please follow the instructions for you platform at:

=https://www.cockroachlabs.com/docs/stable/=

-> Buffalo: Checking installation
✓ The `buffalo` executable was found on your system at: /go/bin/buffalo

-> Buffalo: Checking minimum version requirements
✘ Invalid Semantic Version

-> Buffalo: Application Details
Pwd         /go/src/purple
Root        /go/src/purple
GoPath      /go
PackagePkg  purple
ActionsPkg  purple/actions
ModelsPkg   purple/models
GriftsPkg   purple/grifts
WithModules false
Name        purple
Bin         bin/purple
VCS         git
WithPop     true
WithSQLite  false
WithDep     false
WithWebpack true
WithNodeJs  true
WithYarn    true
WithDocker  true
WithGrifts  true
AsWeb       true
AsAPI       false
InApp       true
PackageJSON {map[]}

-> Buffalo: config/buffalo-app.toml
name = "purple"
bin = "bin/purple"
vcs = "git"
with_pop = true
with_sqlite = false
with_dep = false
with_webpack = true
with_nodejs = true
with_yarn = true
with_docker = true
with_grifts = true
as_web = true
as_api = false

-> Buffalo: config/buffalo-plugins.toml
=[[plugin]]=
  binary = "buffalo-pop"
  go_get = "github.com/gobuffalo/buffalo-pop"
@duckbrain

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

Based on the output, it looks like it checks for npm before yarn.

Output without NPM:

DEBU[2019-08-23T18:33:56Z] Step: 03010c07
DEBU[2019-08-23T18:33:56Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/.codeclimate.yml
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/.env
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/README.md
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/actions/actions_test.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/actions/app.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/actions/home.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/actions/home_test.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/actions/render.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/fixtures/sample.toml
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/grifts/init.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/inflections.json
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/main.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/config/buffalo-app.toml
DEBU[2019-08-23T18:33:56Z] Step: 8c4b0582
DEBU[2019-08-23T18:33:56Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/.dockerignore
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/Dockerfile
DEBU[2019-08-23T18:33:56Z] Step: f5509d85
DEBU[2019-08-23T18:33:56Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/grifts/db.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/models/models.go
DEBU[2019-08-23T18:33:56Z] File: /go/src/purple/models/models_test.go
DEBU[2019-08-23T18:33:56Z] Exec: go get github.com/gobuffalo/pop
DEBU[2019-08-23T18:34:39Z] Step: ea072ebf
DEBU[2019-08-23T18:34:39Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:34:39Z] File: /go/src/purple/database.yml
DEBU[2019-08-23T18:34:39Z] Step: a92dbabe
DEBU[2019-08-23T18:34:39Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:34:39Z] File: /go/src/purple/.buffalo.dev.yml
DEBU[2019-08-23T18:34:39Z] Step: 099f6add
DEBU[2019-08-23T18:34:39Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:34:39Z] Exec: go get github.com/gobuffalo/buffalo-pop
DEBU[2019-08-23T18:35:10Z] Step: 30bda254
DEBU[2019-08-23T18:35:10Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:35:10Z] File: /go/src/purple/config/buffalo-plugins.toml
DEBU[2019-08-23T18:35:10Z] Step: 426edcea
DEBU[2019-08-23T18:35:10Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:35:10Z] Exec: go get -t ./...
DEBU[2019-08-23T18:35:18Z] Step: 01cedf88
DEBU[2019-08-23T18:35:18Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/actions/app.go
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/actions/home.go
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/actions/home_test.go
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/actions/render.go
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/locales/all.en-us.yaml
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/public/robots.txt
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/templates/_flash.plush.html
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/templates/application.plush.html
DEBU[2019-08-23T18:35:18Z] File: /go/src/purple/templates/index.plush.html
DEBU[2019-08-23T18:35:18Z] Step: f485ea90
DEBU[2019-08-23T18:35:18Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:35:18Z] LookPath: npm
Usage:
  buffalo new [name] [flags]

Flags:
      --api                  skip all front-end code and configure for an API server
      --ci-provider string   specify the type of ci file you would like buffalo to generate [none, travis, gitlab-ci] (default "none")
      --config string        config file (default is $HOME/.buffalo.yaml)
      --db-type string       specify the type of database you want to use [cockroach, mysql, postgres, sqlite3] (default "postgres")
      --docker string        specify the type of Docker file to generate [none, multi, standard] (default "multi")
  -d, --dry-run              dry run
  -f, --force                delete and remake if the app already exists
  -h, --help                 help for new
      --module string        specify the root module (package) name. [defaults to 'automatic']
      --skip-config          skips using the config file
      --skip-pop             skips adding pop/soda to your app
      --skip-webpack         skips adding Webpack to your app
      --skip-yarn            use npm instead of yarn for frontend dependencies management
      --vcs string           specify the Version control system you would like to use [none, git, bzr] (default "git")
  -v, --verbose              verbosely print out the go get commands

ERRO[0082] Error: could not find npm executable

Output with NPM:

# buffalo new purple
DEBU[2019-08-23T18:38:37Z] Step: 7764725a
DEBU[2019-08-23T18:38:37Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/.codeclimate.yml
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/.env
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/README.md
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/actions/actions_test.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/actions/app.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/actions/home.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/actions/home_test.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/actions/render.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/fixtures/sample.toml
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/grifts/init.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/inflections.json
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/main.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/config/buffalo-app.toml
DEBU[2019-08-23T18:38:37Z] Step: dce38ff4
DEBU[2019-08-23T18:38:37Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/.dockerignore
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/Dockerfile
DEBU[2019-08-23T18:38:37Z] Step: ba857231
DEBU[2019-08-23T18:38:37Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/grifts/db.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/models/models.go
DEBU[2019-08-23T18:38:37Z] File: /go/src/purple/models/models_test.go
DEBU[2019-08-23T18:38:37Z] Exec: go get github.com/gobuffalo/pop
DEBU[2019-08-23T18:39:25Z] Step: b2213ee3
DEBU[2019-08-23T18:39:25Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:39:25Z] File: /go/src/purple/database.yml
DEBU[2019-08-23T18:39:25Z] Step: 6ee47596
DEBU[2019-08-23T18:39:25Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:39:25Z] File: /go/src/purple/.buffalo.dev.yml
DEBU[2019-08-23T18:39:25Z] Step: c7852843
DEBU[2019-08-23T18:39:25Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:39:25Z] Exec: go get github.com/gobuffalo/buffalo-pop
DEBU[2019-08-23T18:39:56Z] Step: b57afab0
DEBU[2019-08-23T18:39:56Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:39:56Z] File: /go/src/purple/config/buffalo-plugins.toml
DEBU[2019-08-23T18:39:56Z] Step: 083faefd
DEBU[2019-08-23T18:39:56Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:39:56Z] Exec: go get -t ./...
DEBU[2019-08-23T18:40:03Z] Step: 67d745b6
DEBU[2019-08-23T18:40:03Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/actions/app.go
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/actions/home.go
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/actions/home_test.go
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/actions/render.go
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/locales/all.en-us.yaml
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/public/robots.txt
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/templates/_flash.plush.html
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/templates/application.plush.html
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/templates/index.plush.html
DEBU[2019-08-23T18:40:03Z] Step: 0d40922c
DEBU[2019-08-23T18:40:03Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:40:03Z] LookPath: npm
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/.babelrc
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/assets/css/_buffalo.scss
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/assets/css/application.scss
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/assets/images/favicon.ico
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/assets/images/logo.svg
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/assets/js/application.js
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/package.json
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/public/assets/.keep
DEBU[2019-08-23T18:40:03Z] File: /go/src/purple/webpack.config.js
DEBU[2019-08-23T18:40:03Z] LookPath: yarnpkg
DEBU[2019-08-23T18:40:03Z] Exec: yarnpkg install --no-progress --save
DEBU[2019-08-23T18:40:03Z] yarn install v1.17.3

DEBU[2019-08-23T18:40:04Z] info No lockfile found.

DEBU[2019-08-23T18:40:04Z] [1/4] Resolving packages...

DEBU[2019-08-23T18:40:12Z] [2/4] Fetching packages...

DEBU[2019-08-23T18:40:14Z] info fsevents@1.2.9: The platform "linux" is incompatible with this module.

DEBU[2019-08-23T18:40:14Z] info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.

DEBU[2019-08-23T18:40:14Z] [3/4] Linking dependencies...

DEBU[2019-08-23T18:40:16Z] [4/4] Building fresh packages...

DEBU[2019-08-23T18:40:18Z] success Saved lockfile.

DEBU[2019-08-23T18:40:18Z] Done in 14.52s.

DEBU[2019-08-23T18:40:18Z] Step: a6d72246
DEBU[2019-08-23T18:40:18Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:40:18Z] Exec: go get -t ./...
DEBU[2019-08-23T18:40:23Z] Step: 5ed90136
DEBU[2019-08-23T18:40:23Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:40:23Z] Step: 48213790
DEBU[2019-08-23T18:40:23Z] Chdir: /go/src/purple
DEBU[2019-08-23T18:40:23Z] File: /go/src/purple/.gitignore
DEBU[2019-08-23T18:40:23Z] Exec: git init
Initialized empty Git repository in /go/src/purple/.git/
DEBU[2019-08-23T18:40:23Z] Exec: git add .
DEBU[2019-08-23T18:40:23Z] Exec: git commit -q -m Initial Commit
INFO[2019-08-23T18:40:23Z] Congratulations! Your application, purple, has been successfully built!
INFO[2019-08-23T18:40:23Z] You can find your new application at: /go/src/purple
INFO[2019-08-23T18:40:23Z] Please read the README.md file in your new application for next steps on running your application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.