0

Getting error while running jss start at my local, attached screen shot for same." Couldn't find preset "env" relative to directory "~\jss-master\jss-master\samples\basic-sample-react" Trace:

  [1]:  npm run start --                                                                                                                                                                                                                                                                                                                               sitecore-jss-basicapp@7.0.0 start D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react 
                                                                jss clean && node -r babel-register ./build/start.js --env.content=disconnected                                                                                                                                                                                                                                                               Cleaning path ./dist...   
                                                                                                                                              D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-core\lib\transformation\file\options\option-manager.js:328                               throw e;                                                                                                                                                                ^                                                                                                                                                                                                                                                                                                                                       Error: Couldn't find preset "env" relative to directory "D:\\Sitecore\\JSS\\V2\\jss-master\\jss-master\\samples\\basic-sample-react"                                        at D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-core\lib\transformation\file\options\option-manager.js:293:19         
        at Array.map ()                                                                                                                                              at OptionManager.resolvePresets (D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)                                                                                                                                                          at OptionManager.mergePresets (D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)                                                                                                                                                            at OptionManager.mergeOptions (D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)                                                                                                                                                            at OptionManager.init (D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)                                                                                                                                                                    at compile (D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-register\lib\node.js:103:45)                                         at loader (D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-register\lib\node.js:144:14)                                          at Object.require.extensions.(anonymous function) [as .js] (D:\Sitecore\JSS\V2\jss-master\jss-master\samples\basic-sample-react\node_modules\babel-register\lib\node.js:154:7)                                                                                                                                                                  at Module.load (module.js:556:32)                                                                                                                                   npm ERR! code ELIFECYCLE                                                                                                                                                npm ERR! errno 1                                                                                                                                                        npm ERR! sitecore-jss-basicapp@7.0.0 start: `jss clean && node -r babel-register ./build/start.js --env.content=disconnected`                                           npm ERR! Exit status 1                                                                                                                                                  npm ERR!                                                                                                                                                                npm ERR! Failed at the sitecore-jss-basicapp@7.0.0 start 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!    

3
  • Unfortunately I'm unable to repro the issue on a clean pull of the basic-sample-react sample. I tried installing dependencies via both yarn and npm install. Based on the error message, it sounds like there may have been an issue installing the babel-preset-env module. Can you zip up your basic-sample-react folder (including the node_modules folder) and send us a link to download - jss@sitecore.net?
    – Adam Weber
    Mar 2, 2018 at 14:14
  • Also, what version of node.js and npm / yarn are you using?
    – Adam Weber
    Mar 2, 2018 at 14:16
  • 1
    Shared the file with jss@sitecore.net Mar 2, 2018 at 15:09

2 Answers 2

3

It looks like an npm install gone bad as there are several dependencies missing from the node_modules folder. Can you share what version of node.js and npm you're using? Other than that, I would suggest deleting the node_modules folder and the package-lock.json file and running npm install again. Or, just run npm install again (that worked for me locally on your project).

1
  • It worked now the application is loading :) thank u Mar 2, 2018 at 19:26
0

You can try the following commands one by one, these are the dependencies which are not added by default, but are required:

npm install -g ng-cli

npm install -g angular-cli

npm install -g @sitecore-jss/sitecore-jss-cli

npm install

npm start

Just installed the JSS. if those fails try npm update -g

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.