We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation .
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
Node version: 6.9.5
npm version: 3.10.10
Operating system: Windows 10
Command line used: Git Bash
Steps to reproduce:
npm install
npm run setup
(function (exports, require, module, __filename, __dirname) { import { chalkSuccess } from './chalkConfig'; ^^^^^^ SyntaxError: Unexpected token import at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at loader (C:\Users\{project folder}\node_modules\babel-register\lib\node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (C:\Users\{project folder}\node_modules\babel-register\lib\node.js:154:7) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Function.Module.runMain (module.js:604:10) at C:\Users\{project folder}\node_modules\babel-cli\lib\_babel-node.js:159:24 at Object.<anonymous> (C:\Users\{project folder}\node_modules\babel-cli\lib\_babel-node.js:160:7)```
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
I confirmed that the file was there.
I found the reason why in case anyone else comes across this issue. It is specifically a problem with windows machines I believe. I tried the setup on my Ubuntu box and it works fine.
When working with windows you need to have the following installed npm install --save-dev cross-env .
npm install --save-dev cross-env
The reason behind this is that the NODE_ENV var on my machine was set to production and I was unable to set it to development without that module. Once installed and the NODE_ENV=development command was run everything worked out ok.
NODE_ENV
NODE_ENV=development
Great to hear you got it solved Steve! And thanks for sharing your solution. Curious - Why did you have NODE_ENV set to production on your machine?
I'm not entirely sure. I have a feeling it was with another project I was doing with React/webpack earlier this week
I am having the same issue. When I use the slingshot locally on my Mac it is fine. Once I upload it to Github I can't "npm start" without getting the error
/Users/ICe/GitHub/React.StocksApp/tools/startMessage.js:1 (function (exports, require, module, __filename, __dirname) { import { chalkSuccess } from './chalkConfig'; ^^^^^^ SyntaxError: Unexpected token import at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at loader (/Users/ICe/GitHub/React.StocksApp/node_modules/babel-cli/node_modules/babel-register/lib/node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (/Users/ICe/GitHub/React.StocksApp/node_modules/babel-cli/node_modules/babel-register/lib/node.js:154:7) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Function.Module.runMain (module.js:604:10) at /Users/ICe/GitHub/React.StocksApp/node_modules/babel-cli/lib/_babel-node.js:159:24 at Object.<anonymous> (/Users/ICe/GitHub/React.StocksApp/node_modules/babel-cli/lib/_babel-node.js:160:7)
@iM-Durant7 When you say "Once I upload it to Github I can't "npm start" without getting the error", how are you running it when up once up on GitHub? Have you confirmed .babelrc is uploaded?
I created a repo in github and copied the files over from my local machine. After npm install, I used "Npm start -s". You can look at my current repo "React.StocksApp" it has the .babel and I ran a console "hello world" to verify that .babel was working.
@iM-Durant7 Your .babelrc doesn't match Slingshots: https://github.com/coryhouse/react-slingshot/blob/master/.babelrc
I just tried Slingshot's .babelrc on your project and it started fine.
oh wow, ok thanks! I think once I uninstalled the demo project it took my babel away and I was lost ??.
No branches or pull requests