track-focus icon indicating copy to clipboard operation
track-focus copied to clipboard

Can't install with NPM

Open tsteuwer-accesso opened this issue 7 years ago • 10 comments

npm ERR! addLocal Could not install /tmp/npm-10529-4a3e75ba/git-cache-852364e5/2a2caef4e67a0d065af6199350e00bfefca8e332
npm ERR! Linux 4.4.0-97-generic
npm ERR! argv "/home/troy/.nvm/versions/node/v7.0.0/bin/node" "/home/troy/.nvm/versions/node/v7.0.0/bin/npm" "i"
npm ERR! node v7.0.0
npm ERR! npm  v3.10.8

npm ERR! No name provided in package.json
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/troy/development/ShoplandV5/npm-debug.log

This is installing it by adding

  "track-focus": "https://github.com/ten1seven/track-focus.git#1.0.0",

to my package.json file. Any ideas? Is this on NPM because I can't find it.

tsteuwer-accesso avatar Oct 21 '17 13:10 tsteuwer-accesso

You should just need to do "track-focus": "1.0.0" since it's published as a package. You could also try installing it via npm with npm install track-focus. Let me know if either of those don't work.

ten1seven avatar Oct 21 '17 15:10 ten1seven

npm i --save-dev track-focus

troy@troydesktop:~/development/troy$ npm i --save-dev track-focus
npm WARN package.json [email protected] royNo repository field.
npm WARN package.json [email protected] No license field.
npm ERR! Linux 4.4.0-97-generic
npm ERR! argv "/home/troy/.nvm/versions/node/v4.5.0/bin/node" "/home/troy/.nvm/versions/node/v4.5.0/bin/npm" "i" "--save-dev" "track-focus"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/track-focus
npm ERR! 404 
npm ERR! 404 'track-focus' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'troy'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/troy/development/troy/npm-debug.log

tsteuwer-accesso avatar Oct 29 '17 12:10 tsteuwer-accesso

Okay, give it a try now. I tried publishing again and tested.

ten1seven avatar Oct 31 '17 15:10 ten1seven

@ten1seven once it's installed with npm how is it used? It doesn't export anything, so I can't just import it AFAIK...

smiller171 avatar Feb 08 '18 17:02 smiller171

@smiller171 You should be able to import or require it per the options I outlined in the usage section of the README. Is it failing when you try this?

ten1seven avatar Feb 08 '18 18:02 ten1seven

@ten1seven You pointed me at the usage section for a different package. I have it executing, but it's not working, and I'm trying to figure out why. I think it may be related to the fact that I'm using Vue, which uses a virtual dom. I can confirm it's getting the correct element, but it's not adding the class. Quite infuriating.

smiller171 avatar Feb 08 '18 18:02 smiller171

Oops, you're right!

Have you tried What Input for this functionality? It's the replacement for Track Focus and I actively maintain it.

ten1seven avatar Feb 08 '18 18:02 ten1seven

Thanks @ten1seven! What Input works great!

smiller171 avatar Feb 08 '18 20:02 smiller171

Good to know that it plays well with Vue! I hadn't explicitly tested it in that environment.

ten1seven avatar Feb 08 '18 20:02 ten1seven

Yeah, I think using attribute selectors makes a huge difference, because most of the logic can happen in the Vue scoped CSS now.

smiller171 avatar Feb 08 '18 20:02 smiller171