sveltejs / sapper-template

Starter template for Sapper apps
703 stars 214 forks source link

npm run export error: Cannot find module sapper #259

Closed silvioprog closed 4 years ago

silvioprog commented 4 years ago

Hi.

I have been trying to use npm run export in my application, but it raises the following error:

C:\Users\silvi\Desktop\sapper\my-app>npm run export

> TODO@0.0.1 export C:\Users\silvi\Desktop\sapper\my-app
> sapper export

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

Error: Cannot find module 'C:\Users\silvi\Desktop\sapper\my-app\node_modules\sapper\sapper'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! TODO@0.0.1 export: `sapper export`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the TODO@0.0.1 export script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\silvi\AppData\Roaming\npm-cache\_logs\2020-09-01T17_50_51_169Z-debug.log

I tried to install sapper using npm install -g sapper, anyway, the error persists.

So, what should be done before running npm install -g sapper?

TIA

benmccann commented 4 years ago

I wouldn't do npm install -g sapper, but just npm install to install all dependencies. Discord or StackOverflow is a better place for questions. The issue tracker is only meant for bug reports, so I'm going to go ahead and close this