Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '@slidev/parser/fs' #10

Closed
manuelabarca opened this issue May 5, 2021 · 9 comments
Closed

Cannot find module '@slidev/parser/fs' #10

manuelabarca opened this issue May 5, 2021 · 9 comments

Comments

@manuelabarca
Copy link

When I run "npm init slidev" I failed to find the module "Error: Cannot find module '@slidev/parser/fs'

@antfu
Copy link
Member

antfu commented May 5, 2021

Can I have more context?

@manuelabarca
Copy link
Author

Can I have more context?

I followed the instructions, execute the command "npm init slidev" and also now test with yarn but when it is executing and installing everything the terminal crashes and tells me "Cannot find module '@slidev/parser/fs'" I guess when you try to lift it because I tried to run the command "npm run dev" and couldn't get the project up either.

@christian-nils
Copy link
Contributor

Hi! I have the same issue. Created a new folder, went in, and then executed npm init slidev, I get:

internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module '@slidev/parser/fs'
Require stack:
- /home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/dist/chunk-ZHBXU56W.js
- /home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/dist/chunk-ASIFYNQ3.js
- /home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/dist/cli.js
- /home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/bin/slidev.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/dist/chunk-ZHBXU56W.js:158:12)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/dist/chunk-ZHBXU56W.js',
    '/home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/dist/chunk-ASIFYNQ3.js',
    '/home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/dist/cli.js',
    '/home/christian-nils/Repos/slidev/slidev/node_modules/@slidev/cli/bin/slidev.js'
  ]
}
npm ERR! code 1
npm ERR! path /home/christian-nils/Repos/slidev/slidev
npm ERR! command failed
npm ERR! command sh -c slidev

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/christian-nils/.npm/_logs/2021-05-05T14_33_22_086Z-debug.log
Error: Command failed with exit code 1: npm run dev
    at makeError (/home/christian-nils/.npm/_npx/c00c242a51a5200e/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/christian-nils/.npm/_npx/c00c242a51a5200e/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async init (/home/christian-nils/.npm/_npx/c00c242a51a5200e/node_modules/create-slidev/index.js:121:5) {
  shortMessage: 'Command failed with exit code 1: npm run dev',
  command: 'npm run dev',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

@antfu
Copy link
Member

antfu commented May 5, 2021

Oh, sorry, I mean, OS, npm/yarn/pnpm, node version, etc.

@antfu
Copy link
Member

antfu commented May 5, 2021

Looks like you will need node >= v12.17 I guess?
https://nodejs.org/api/packages.html#packages_subpath_exports

@christian-nils
Copy link
Contributor

For me:

Fedora 34
npm 7.6.3
node v12.16.1

@antfu
Copy link
Member

antfu commented May 5, 2021

@christian-nils Guess you would need upgrade to node v14, as node v12 out of LTS now. I will add the engine field in the packages. Thanks

@manuelabarca
Copy link
Author

Oh, sorry, I mean, OS, npm/yarn/pnpm, node version, etc.

Mac Catalina (10.15.7)
Npm 6.12.0
Node 12.13.0

@christian-nils
Copy link
Contributor

christian-nils commented May 5, 2021

@christian-nils Guess you would need upgrade to node v14, as node v12 out of LTS now. I will add the engine field in the packages. Thanks

Good point, I actually have an higher version. Just mixed up the node versions in nvm. Thanks for pointing that out! And thanks for your work! :) I don't have the issue with node v.16.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants