0

The global install of this CLI started failing and I'm not sure why.

git clone https://github.com/superflycss/cli
cd cli
npm i -g

The log file is 10K lines log, but this is what it says at the end:

    7353 verbose stack Error: ENOENT: no such file or directory, rename '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@superflycss/cli-5549c074/node_modules/@babel/code-frame' -> '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@babel/code-frame-78217d7a'
    7354 verbose cwd /home/ole/SuperflyCSS/cli
    7355 verbose Linux 4.15.0-45-generic
    7356 verbose argv "/home/ole/.nvm/versions/node/v11.0.0/bin/node" "/home/ole/.nvm/versions/node/v11.0.0/bin/npm" "i" "-g"
    7357 verbose node v11.0.0
    7358 verbose npm  v6.7.0
    7359 error path /home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@superflycss/cli-5549c074/node_modules/@babel/code-frame
    7360 error code ENOENT
    7361 error errno -2
    7362 error syscall rename
    7363 error enoent ENOENT: no such file or directory, rename '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@superflycss/cli-5549c074/node_modules/@babel/code-frame' -> '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@babel/code-frame-78217d7a'
    7364 error enoent This is related to npm not being able to find a file.
    7365 verbose exit [ -2, true ]

I've tried removing all global modules per the instructions here and then reinstalling. However it still fails, even with a complete local module refresh (Nuke local node_modules).

Also tried:

sudo rm -fr /home/ole/.npm-packages/*

And then npm i -g and the result is still the same.

Update

I think it might be this bug:

https://npm.community/t/global-installs-sudo-npm-i-g-fail-on-mac-after-6-5-upgrade-works-fine-after-6-4-1-downgrade/4082/15

Ole
  • 41,793
  • 59
  • 191
  • 359

3 Answers3

0

Maybe you could try installing the superflycss CLI globally with npm through the npmjs registry as opposed to cloning the superflycss repository and trying to build from source. For example:

npm i -g @superflycss/cli

then just use it like so:

  Usage: sfc [options] [command]

Hopefully that helps!

Nathan
  • 7,853
  • 4
  • 27
  • 50
  • I also do that - But I'm the author of the CLI, so I need to be able to install locally for dev purposes. – Ole Feb 06 '19 at 22:53
0
docker run -it node bash
git clone https://github.com/superflycss/cli
cd cli
npm i -g

Works just fine!

root@c3adb3ae08aa:/cli# sfc --version
1.0.0
root@c3adb3ae08aa:/cli# sfc --help
Usage: sfc [options] [command]

SuperflyCSS Command Line Interface
[more stuff here]

Try clearing your node_modules global cache and local dir.

enapupe
  • 15,691
  • 3
  • 29
  • 45
  • I updated the question with the step I did for removing global modules. I wonder if it has something to do with npm version 6.7.0 ... I think this started to happen after I installed that. It was working fine for me too. – Ole Feb 07 '19 at 00:07
  • I'm also using this (npm i -g without sudo): https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md – Ole Feb 07 '19 at 00:13
-1

Fixed this by upgrading to node v11.9.0 and NPM v6.7.0.

Ole
  • 41,793
  • 59
  • 191
  • 359