Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Deploy to Now

Seokhyun Wie
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Seokhyun Wie
Full Stack JavaScript Techdegree Graduate 21,606 Points

Error while deploying my app with NOW

I have errors regarding fsevents module (it has bothered be every time during npm install with 'deprecated' issues) and life cycle error. Here's the link of the error, https://zeit.co/brandonwie/practicereactrouter/qmhruoozn

Downloading 37 deployment files...
Installing build runtime...
Build runtime installed: 505.286ms
Looking up build cache...
Installing dependencies...
> core-js@2.6.11 postinstall /zeit/8357d63/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> core-js@3.6.4 postinstall /zeit/8357d63/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure@3.6.4 postinstall /zeit/8357d63/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 1608 packages from 757 contributors in 21.735s
Running "npm run now-build"
> course-directory@0.1.0 now-build /zeit/8357d63
> react-scripts build && my build dist
Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
  48.47 KB (-6 B)  build/static/js/2.cc722835.chunk.js
  5.14 KB (-14 B)  build/static/js/main.c774ea57.chunk.js
  1.05 KB          build/static/css/main.ceca84a1.chunk.css
  797 B            build/static/js/runtime-main.db9a898d.js
The project was built assuming it is hosted at /practice_React_Router/.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
To publish it at https://brandonwie.github.io/practice_React_Router/ , run:
  npm run deploy
Find out more about deployment here:
  bit.ly/CRA-deploy
sh: my: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! course-directory@0.1.0 now-build: `react-scripts build && my build dist`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the course-directory@0.1.0 now-build 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!     /zeit/.npm/_logs/2020-01-21T08_36_47_305Z-debug.log
Error: Exited with 1
    at ChildProcess.child.on (/zeit/7783010c87aa68f0/.build-utils/.builder/node_modules/@now/static-build/dist/index.js:31880:24)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
worker exited with code 20 and signal null
done

1 Answer

Ian Ostrom
seal-mask
.a{fill-rule:evenodd;}techdegree
Ian Ostrom
Full Stack JavaScript Techdegree Student 10,332 Points

The fsevents problems are probably from using the files provided by Guil, which has out of date dependencies. In another folder, type npx create-react-app name-of-project to set up a new project using Create React App. Then replace the entire contents of the src folder with those from your project. Type npm start and you are good to go.

In another note, you can skip most of what is presented in this video, including the now.json file, and just type now to deploy your app. It will prompt you for any info it needs. Or use their online tool.