我有一台未连接到互联网的工作开发机器。我正在使用atom作为我的编辑器,并且不能像通常那样安装软件包。我在另一台机器上下载了软件包并将软件包解压缩到〜/ .atom / packages。包,atom-beautify包显示在包选项卡下,但在尝试使用它时收到此错误消息:
Error: Cannot find module 'event-kit'
at Module._resolveFilename (module.js:338:15)
at Function.Module._resolveFilename (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\module-cache.js:383:52)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\native-compile-cache.js:50:27)
at Object.<anonymous> (file:///C:/Users/quentin.goehrig.RD/.atom/packages/atom-beautify-master/src/beautify.coffee:7:25)
at Object.<anonymous> (file:///C:/Users/quentin.goehrig.RD/.atom/packages/atom-beautify-master/src/beautify.coffee:2:1)
at Module._compile (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\native-compile-cache.js:103:30)
at Object.defineProperty.value [as .coffee] (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\compile-cache.js:208:21)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\native-compile-cache.js:50:27)
at Package.module.exports.Package.requireMainModule (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\package.js:715:27)
at Package.module.exports.Package.activateNow (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\package.js:173:16)
at C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\package.js:795:25
at Function.module.exports.Emitter.simpleDispatch (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\command-registry.js:241:20)
at CommandRegistry.handleCommandEvent (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\command-registry.js:160:19)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\atom-environment.js:1100:28)
at EventEmitter.outerCallback (C:\Users\quentin.goehrig.RD\AppData\Local\atom\app-1.7.4\resources\app.asar\src\application-delegate.js:314:25)
at emitTwo (events.js:87:13)
at EventEmitter.emit (events.js:172:7)
错误是从atom-beautify包中抛出的。
我尝试过运行apm install,但我没有运气。任何帮助将不胜感激!
apm -v
apm 1.9.2
npm 2.13.3
node 0.10.40
python 3.5.1
git 1.9.4.mysgit.2
visual studio
答案 0 :(得分:2)
程序应如下(以原子美化为例):
~/.atom/packages
; ~/.atom/packages/atom-beautify
; npm install
。或者您可以使用以下命令直接从一开始就安装软件包:
apm install atom-beautify
apm完成从下载到安装的工作。
答案 1 :(得分:0)
您可以直接从设置中使用原子包安装程序。这是安装任何软件包的最简单方法。启用。