file-icons / atom

Atom file-specific icons for improved visual grepping.
MIT License
1.32k stars 250 forks source link

Failed to activate the tree-view package since update new version file-icon #752

Closed GHLandy closed 6 years ago

GHLandy commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.29.0 x64 Electron: 2.0.7 OS: "Arch Linux" Thrown From: tree-view package 0.222.0

Stack Trace

Failed to activate the tree-view package

At normalisePath is not a function

TypeError: normalisePath is not a function
    at IconDelegate.deserialise (/packages/file-icons/lib/service/icon-delegate.js:227:16)
    at /packages/file-icons/lib/service/icon-delegate.js:19:8)
    at IconService.handleResource (/packages/file-icons/lib/service/icon-service.js:54:16)
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:27:14)
    at Emitter.module.exports.Emitter.emit (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:156:28)
    at FileSystem.get (/packages/file-icons/node_modules/atom-fs/lib/filesystem.js:92:17)
    at Function.forElement (/packages/file-icons/lib/service/icon-node.js:179:28)
    at /packages/file-icons/lib/service/icon-service.js:93:31)
    at IconServices.updateDirectoryIcon (/usr/lib/atom/node_modules/tree-view/lib/get-icon-services.js:53:31)
    at DirectoryView.module.exports.DirectoryView.updateIcon (/usr/lib/atom/node_modules/tree-view/lib/directory-view.js:85:32)
    at /usr/lib/atom/node_modules/tree-view/lib/directory-view.js:35:24
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:27:14)
    at Emitter.module.exports.Emitter.emit (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:156:28)
    at IconServices.setElementIcons (/usr/lib/atom/node_modules/tree-view/lib/get-icon-services.js:40:20)
    at TreeViewPackage.consumeElementIcons (/usr/lib/atom/node_modules/tree-view/lib/tree-view-package.js:45:23)
    at Provider.module.exports.Provider.provide (/usr/lib/atom/node_modules/service-hub/lib/provider.js:34:52)
    at ServiceHub.module.exports.ServiceHub.consume (/usr/lib/atom/node_modules/service-hub/lib/service-hub.js:50:18)
    at Package.activateServices (/usr/lib/atom/src/package.js:400:73)
    at Package.activateNow (/usr/lib/atom/src/package.js:228:14)
    at measure (/usr/lib/atom/src/package.js:201:27)
    at Package.measure (/usr/lib/atom/src/package.js:83:19)
    at activationPromise.Promise (/usr/lib/atom/src/package.js:195:14)
    at new Promise (<anonymous>)
    at Package.activate (/usr/lib/atom/src/package.js:193:32)
    at PackageManager.activatePackage (/usr/lib/atom/src/package-manager.js:684:36)
    at config.transactAsync (/usr/lib/atom/src/package-manager.js:659:30)
    at Config.transactAsync (/usr/lib/atom/src/config.js:866:22)
    at PackageManager.activatePackages (/usr/lib/atom/src/package-manager.js:657:17)
    at PackageManager.activate (/usr/lib/atom/src/package-manager.js:636:44)
    at loadStatePromise.loadState.then (/usr/lib/atom/src/atom-environment.js:857:21)

Commands

Non-Core Packages

atom-beautify 0.33.0 
color-picker 2.3.0 
docblockr 0.13.7 
editorconfig 2.2.2 
emmet 2.4.3 
file-icons 2.1.22 
language-apache 1.8.0 
language-babel 2.85.0 
language-ejs 0.4.0 
language-markdown 0.26.0 
language-nginx 0.8.0 
language-postcss 1.3.1 
language-pug 0.0.22 
language-vue 0.23.1 
minimap 4.29.8 
open-in-browser 0.5.2 
pigments 0.40.2 
split-diff 1.5.2 
Alhadis commented 6 years ago

The normalisePath function was recently moved from alhadis.utils to the atom-fs module, but those changes haven't been published. It sounds as though that dependency was installed by downloading from the repo's master branch. :|

Could you copy+paste the contents of ~/.atom/packages/file-icons/node_modules/atom-fs/package.json, please? Since you're using an Arch Linux port of Atom, it's possible (though unlikely) that files are getting installed incorrectly.

Alhadis commented 6 years ago

Actually, I haven't bumped this repository's dependencies yet, so it's much more likely that you've installed this package from master. Did you install file-icons through Atom's "Packages" panel, or by cloning with git?

GHLandy commented 6 years ago

I clone the file-icons repo into ~/.atom/packages,because it is faster this way compare to using atom pannel. And I install all dependecies under file-icons by npm i, not changing any branch. Need I change it?

{
  "_from": "atom-fs@v0.1.4",
  "_id": "atom-fs@0.1.4",
  "_inBundle": false,
  "_integrity": "sha512-QZ5z6kyQP/YiCgIWY3gF6rMrTRyomJzUTkMLQHxOEmgvF+xujpf/OFpRjJqACsf3DDU/eKtUULud23yu0O1b8A==",
  "_location": "/atom-fs",
  "_phantomChildren": {},
  "_requested": {
    "type": "version",
    "registry": true,
    "raw": "atom-fs@v0.1.4",
    "name": "atom-fs",
    "escapedName": "atom-fs",
    "rawSpec": "v0.1.4",
    "saveSpec": null,
    "fetchSpec": "v0.1.4"
  },
  "_requiredBy": [
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/atom-fs/-/atom-fs-0.1.4.tgz",
  "_shasum": "4a873a19b484137bc942f656ecb00f4de7760430",
  "_spec": "atom-fs@v0.1.4",
  "_where": "/home/ghlandy/.atom/packages/file-icons",
  "atom-mocha": {
    "mocha": {
      "require": "chai/should"
    }
  },
  "atomTestRunner": "atom-mocha",
  "author": {
    "name": "John Gardner",
    "email": "gardnerjohng@gmail.com"
  },
  "bugs": {
    "url": "https://github.com/Alhadis/Atom-FS/issues"
  },
  "bundleDependencies": false,
  "dependencies": {
    "alhadis.utils": "*"
  },
  "deprecated": false,
  "description": "Filesystem abstraction layer for Atom",
  "devDependencies": {
    "atom-mocha": "*"
  },
  "engines": {
    "atom": ">=1.13.0"
  },
  "homepage": "https://github.com/Alhadis/Atom-FS#readme",
  "license": "ISC",
  "name": "atom-fs",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Alhadis/Atom-FS.git"
  },
  "version": "0.1.4"
}
Alhadis commented 6 years ago

Ah, that explains it. Yes, you should install through Atom or checkout the latest tagged release:

$ git checkout v2.1.22

I recommend using Atom, because it'll keep the package updated for you.

GHLandy commented 6 years ago

Ok, Thanks, it works!