question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't find module 'less'

See original GitHub issue

when I choose the option ‘markdown to pdf’, the error occurs like this:

Failed to activate the markdown-pdf package Cannot find module ‘less’

Error: Cannot find module 'less'
at Module._resolveFilename (module.js:470:15)
at Module._resolveFilename (/opt/atom/resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.get_Module._resolveFilename (/opt/atom/resources/app/src/module-cache.js:354:58)
at Module.require (file:///opt/atom/resources/app.asar/static/index.js:40:43)
at require (/opt/atom/resources/app/src/native-compile-cache.js:66:33)
at loadDeps (/home/holyshine/.atom/packages/travs-markdown-pdf-a4918aa/lib/markdown-pdf.js:14:10)
at Object.activate (/home/holyshine/.atom/packages/travs-markdown-pdf-a4918aa/lib/markdown-pdf.js:50:5)
at Package.module.exports.Package.activateNow (/opt/atom/resources/app/src/package.js:253:25)
at /opt/atom/resources/app/src/package.js:984:31
at Function.module.exports.Emitter.simpleDispatch (/opt/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at CommandRegistry.handleCommandEvent (/opt/atom/resources/app/src/command-registry.js:353:24)
at CommandRegistry.dispatch (/opt/atom/resources/app/src/command-registry.js:266:23)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/opt/atom/resources/app/src/atom-environment.js:1382:34)
at EventEmitter.outerCallback (/opt/atom/resources/app/src/application-delegate.js:335:31)
at emitThree (events.js:116:13)
at EventEmitter.emit (events.js:194:7)`

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
travscommented, Mar 25, 2020

@ChaosVan Going out on a limb here, but might it be that these dependencies aren’t downloading due to firewalls? Try the solutions mentioned here and here and let me know if either of them work.

As a last resort, you could try going to the package in the atom config dir (mine is ~/.atom/packages/markdown-pdf and run npm i from there.

1reaction
Musickillercommented, Feb 19, 2018

@jantonioavalos @qiyexue777 @Holy-Shine try installing that module =)

npm install -g less

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack error in Cannot find module 'less' - Stack Overflow
This error happens because npm@3 does not resolve peerDependencies any more. npm install less less-loader is the way to go.
Read more >
"Error in Cannot find module 'less'" when missing loaders ...
This error happens because npm@3 does not resolve peerDependencies anymore. npm install less less-loader is the way to go. Such an elegant fix....
Read more >
less-loader - npm
less -loader applies a Less plugin that passes all queries to the webpack resolver if less could not resolve @import . Thus you...
Read more >
Error: Cannot find module 'less' - WayneLiu123 - 博客园
Error : Cannot find module 'less' ... 编辑推荐: · 应届毕业生程序员在面试时如何做好自我介绍? ... · [深度思考]如何优雅的校验参数? ... 阅读排行: · ...
Read more >
cannot find module "less" - 掘金
cannot find module "less" · 1. 查找原因. 1. 首先查看了本地的全局安装依赖,未安装less。 · 2. 定位原因. 通过上面的分析可知,最可能的原因是less- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found