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

Unexpected token import when running getStorybook #1943

Closed
nicolechung opened this issue Oct 2, 2017 · 5 comments
Closed

Unexpected token import when running getStorybook #1943

nicolechung opened this issue Oct 2, 2017 · 5 comments

Comments

@nicolechung
Copy link

I installed storybook globally, but when I run getStorybook I get the following error:

/Users/username/.nvm/versions/node/v8.1.3/lib/node_modules/@storybook/cli/bin/generate.js:1
(function (exports, require, module, __filename, __dirname) { import updateNotifier from 'update-notifier';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/username/.nvm/versions/node/v8.1.3/lib/node_modules/@storybook/cli/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)

Is it my node version?

@nickjohnson-dev
Copy link

nickjohnson-dev commented Oct 2, 2017

I just had this issue as well. Downgrading to storybook/cli@3.2 fixed it.

@shilman: Looks like the 3.3.0-alpha.1 version got published on the latest tag. I'm not sure if this was on purpose or not, but just wanted to let you know.


Update: With version 3.2 the cli works fine, but it's installing @ storybook/react@3.3.0-alpha.1, and that appears to be broken as well.

Update 2: After blowing my node_modules away, @ storybook/react@3.3.0-alpha.1 seems to be working okay.

@shilman
Copy link
Member

shilman commented Oct 3, 2017

@nickjohnson-dev @nicolechung Sorry we had an NPM disaster earlier today (I'll spare you the details, unless you're curious). Now 3.2.12 should be the latest and I'd recommend you use that (unless you're cool using possibly unstable prerelease software, in which case it's all good).

Please let me know if you run into any more problems, and sorry for the trouble.

@shilman
Copy link
Member

shilman commented Oct 3, 2017

Also, if you are still having this problem after we sorted our NPM troubles, please try deleting node_modules and your lock files (if you have any), and reinstalling. We've also seen some caching issues with babel-runtime that might be causing things to fail in this way.

@nicolechung
Copy link
Author

Thank you for fixing this so quickly!

@nickjohnson-dev
Copy link

I've had my fair share of NPM disasters, I know those are stressful. 😥

Thanks for the quick work on this bug, and on the great work in general. I'm loving this great tool as always! 👍

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

No branches or pull requests

4 participants