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

Can't run the JS examples local server - can't find dist\Dropbox-sdk.js #621

Open
ciufudean opened this issue Apr 15, 2021 · 10 comments
Open
Labels

Comments

@ciufudean
Copy link

Describe the bug
I am following the instructions at https://github.com/dropbox/dropbox-sdk-js/tree/main/examples/javascript to run the examples server.
node server.js crashes with

e:\temp\dropbox-sdk-js\examples\javascript>node server.js
e:\temp\dropbox-sdk-js\node_modules\rollup-endpoint\index.js:15
    throw Error('[rollup-endpoint] File does not exist: ' + options.entry);
    ^

Error: [rollup-endpoint] File does not exist: e:\temp\dropbox-sdk-js\dist\Dropbox-sdk.js
    at Object.exports.serve (e:\temp\dropbox-sdk-js\node_modules\rollup-endpoint\index.js:15:11)
    at Object.<anonymous> (e:\temp\dropbox-sdk-js\examples\javascript\server.js:12:10)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

Versions

  • What version of the SDK are you using? 9.6.0
  • What version of the language are you using? node v14.16.0
  • Are you using Javascript or Typescript? JS
  • What platform are you using? (if applicable) Windows 10

Additional context
Add any other context about the problem here.

@ciufudean ciufudean added the bug label Apr 15, 2021
@greg-db
Copy link
Contributor

greg-db commented Apr 15, 2021

Apologies for the trouble! The current instructions for running the examples are out of date. I'll ask the team to fix that up. To get this running, you'll need to run npm run build in between running npm install and node server.js.

@ciufudean
Copy link
Author

I thought this is the case, but build was failing for me too, so I used the dist file from the npm dropbox package.

@greg-db
Copy link
Contributor

greg-db commented Apr 16, 2021

I see, thanks for the information. Installing from a package manager is certainly fine, but if you'd like us to look into the build issue anyway, please share the error output you're getting from npm run build.

@ciufudean
Copy link
Author

e:\temp\dropbox-sdk-js>npm run build

dropbox@9.6.0 build e:\temp\dropbox-sdk-js
npm run build:es && npm run build:cjs && npm run build:umd && npm run build:umd:min

dropbox@9.6.0 build:es e:\temp\dropbox-sdk-js
cross-env BABEL_ENV=es babel src -d es/src; cross-env BABEL_ENV=es babel lib -d es/lib; cross-env BABEL_ENV=es babel index.js -d es

babel:
cross-env does not exist
BABEL_ENV=es does not exist
babel does not exist
npm ERR! code ELIFECYCLE
npm ERR! errno 2

@greg-db
Copy link
Contributor

greg-db commented Apr 16, 2021

Thanks! Those should have been installed by npm install. Did the npm install command also fail? Can you share the output for that if so?

@ciufudean
Copy link
Author

ciufudean commented Apr 16, 2021

I found the cause. Your build:xx npm scripts are using ; as a command separator, while on Windows this is & or &&.
And a few solutions here

@greg-db
Copy link
Contributor

greg-db commented Apr 19, 2021

Thanks! We'll look into it.

@RichardJECooke
Copy link

Documentation still wrong a year later

@greg-db
Copy link
Contributor

greg-db commented Aug 18, 2022

@RichardJECooke Thanks for the note. This is still open with the team. I'll check in with them on this and follow up here with any updates.

@matrix75
Copy link

The ';' on windows is indeed an issue. Switching to '&' was the fix for the build.

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

No branches or pull requests

4 participants