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.

Cannot find module './dist/cpexcel' - packaging bug

See original GitHub issue

Hey, I’m getting an error on this:

var XLSX = require('xlsx');

Here’s the stack trace:

Error: Cannot find module './dist/cpexcel'
    at require (packages/modules-runtime.js:109:19)
    at make_xlsx (packages/modules.js:422:47)
    at meteorInstall.node_modules.xlsx.xlsx.js (packages/modules.js:12065:3)
    at fileEvaluate (packages/modules-runtime.js:181:9)
    at require (packages/modules-runtime.js:106:16)
    at meteorInstall.server.platform.Methods.js (server/platform/Methods.js:35:12)
    at fileEvaluate (packages/modules-runtime.js:181:9)
    at require (packages/modules-runtime.js:106:16)
    at /home/michael/scm/pid/Iron-Ruler-v2/app/.meteor/local/build/programs/server/app/app.js:3749:1
    at /home/michael/scm/pid/Iron-Ruler-v2/app/.meteor/local/build/programs/server/boot.js:295:34
    at Array.forEach (native)
    at Function._.each._.forEach (/home/michael/.meteor/packages/meteor-tool/.1.4.2_3.m9wg9m++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
    at /home/michael/scm/pid/Iron-Ruler-v2/app/.meteor/local/build/programs/server/boot.js:128:5
    at /home/michael/scm/pid/Iron-Ruler-v2/app/.meteor/local/build/programs/server/boot.js:344:5
    at Function.run (/home/michael/scm/pid/Iron-Ruler-v2/app/.meteor/local/build/programs/server/profile.js:480:12)
    at /home/michael/scm/pid/Iron-Ruler-v2/app/.meteor/local/build/programs/server/boot.js:343:11
Exited with code: 1

Here is a list of node_modules:

☀  ls node_modules                                                                                      Mod dev
adler-32       center-align   exit-on-epipe      locutus               readable-stream       util-deprecate
align-text     cfb            frac               longest               regenerator-runtime   voc
amdefine       cliui          graceful-readlink  meteor-node-stubs     repeat-string         webshot
async          codepage       handlebars         minimist              right-align           window-size
autoprefixer   colors         highcharts         moment                source-map            wordwrap
babel-runtime  commander      inherits           nan                   ssf                   xlsx
babyparse      concat-stream  isarray            node-hubspot          string_decoder        yaml-js
bcrypt         core-js        is-buffer          optimist              toastr                yargs
bindings       core-util-is   jszip              pako                  typedarray
bourbon        crc-32         kind-of            printj                uglify-js
camelcase      decamelize     lazy-cache         process-nextick-args  uglify-to-browserify

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
madewithyoucommented, Jul 25, 2017

For the ones like me who just miss the --save in the install…

meteor npm install xlsx --save

1reaction
reviewhercommented, Dec 31, 2016

@MichaelJCole I was able to reproduce your issue and I believe you need to add a line to the package.json.

Steps:

$ curl https://install.meteor.com/ | sh
$ meteor create ~/my_cool_app
$ cd ~/my_cool_app
$ meteor npm install xlsx
$ vim server/main.js
### add the line var XLSX = require('xlsx'); to the file server/main.js
$ meteor
### ... errors show up
$ vim package.json
### add the line     "xlsx": "" in the block
$ npm install
$ meteor
### no errors

Not familiar with meteor so I am not sure if that is the correct approach.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module in JavaScript [SOLVED]
Solution: Install missing module using Node Package Manager. The Node Package Manager, popularly known as npm is a command line tool that helps...
Read more >
Xlsx-style-correct NPM
Check Xlsx-style-correct 1.0.0 package - Last release 1.0.0 with MIT ... node_modules/xlsx-style/dist/cpexcel.js Module not found: Error: Can't resolve '.
Read more >
Cannot find module 'xlsx' - node.js - Stack Overflow
import xlsx from 'xlsx/xlsx';. This line works for me on node/typescript environment.
Read more >
xlsx - npm Package Health Analysis - Snyk
Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice. Get ... Looks like xlsx is missing a...
Read more >
sheetjs - webcomponents.org
The npm package also exposes the module with the module parameter, supported in ... import * as cptable from 'https://unpkg.com/xlsx/dist/cpexcel.full.mjs'; ...
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