foundation/foundation-cli

Installation failure when CLI is already existed

dnhn opened this issue · 0 comments

dnhn commented

WHEN

  • User installs CLI

    npm install -g foundation-cli
    

IF

  • The CLI has been already installed

PROBLEM

  • Installation failure

  • If there are multiple packages in the installation command, they will be broken and need to be reinstalled

    npm install -g @angular/cli babel-cli foundation-cli ...
    

OUTPUT

npm WARN deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm ERR! path /usr/local/lib/node_modules/foundation-cli/node_modules/npm/node_modules/ansistyles
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/foundation-cli/node_modules/npm/node_modules/ansistyles' -> '/usr/local/lib/node_modules/foundation-cli/node_modules/npm/node_modules/.ansistyles.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxxxxx/.npm/_logs/2018-02-15T12_19_11_769Z-debug.log

WORKAROUND

  • Installed CLI only: uninstall then reinstall the CLI
  • Installed along with other packages: reinstall CLI and packages from the installation command
Running environment:
  • OS: macOS Sierra 10.12.6
  • Node.js: 8.9.4
  • NPM: 5.6.0
  • foundation-cli: 2.2.5