Importing Skygear Cloud


I am trying to import skygear cloud but it keeps giving an npm error even on a fresh installation

Module not found: Can’t resolve ‘dns’ in ‘C:\Users\me\Desktop\Work\practice\test-admin\node_modules\pg\lib’


May you put the commands you run here so we can help look into it?

import skygear from 'skygear';
import {
} from './config';
import skygearCloud from 'skygear/cloud'

My package.json is a basic create-react-app using react-admin


What about the command you typed? And would you mind to simply zip the folder for me?

Since the error is about a node module not found I am suspecting it is something because of the packages and the command to load the modules


Hey there, @bencheng. Sorry did not reply for long but moved on to a different solution. However would love to know a solution for the same question. Please check on this repo


Sorry may you clarify what is the problem you have? What did you type or done? It seems something with the node.js environment on your computer.


I’m using create-react-app on Windows 10, found that I needed packages dns and pg-native installed. pg-native installed correctly but dns failed to install correctly.

Which brought up critical dependency errors.

Could it be a OS issue?


Hello David!

You got that error because you have imported skygearCloud (which is expected to be run in a node environment) in App.js (which is expected to be run in the browser).

You can check out the cloud functions guide to learn about how to work with skygearCloud: